From d3d7e8aca37af7a3c13554082428824d2dff72c0 Mon Sep 17 00:00:00 2001 From: "antonio.torre" Date: Mon, 16 Dec 2024 18:02:30 +0100 Subject: [PATCH] P4ADEV-1669 init repo --- .github/CODEOWNERS | 2 +- .github/terraform/.terraform.lock.hcl | 45 +++++++++++++++ .github/terraform/00_data.tf | 26 +++++++-- .github/terraform/99_locals.tf | 22 +++---- .github/terraform/99_variables.tf | 2 +- .github/terraform/env/itn-dev/backend.ini | 1 - .github/terraform/env/itn-dev/backend.tfvars | 4 -- .../terraform/env/itn-dev/terraform.tfvars | 4 -- .github/terraform/env/itn-prod/backend.ini | 2 +- .github/terraform/env/itn-prod/backend.tfvars | 4 +- .../terraform/env/itn-prod/terraform.tfvars | 8 ++- .github/terraform/env/itn-uat/backend.ini | 1 - .github/terraform/env/itn-uat/backend.tfvars | 4 -- .../terraform/env/itn-uat/terraform.tfvars | 3 - .github/workflows/codereview.yml | 2 +- README.md | 57 +------------------ build.gradle.kts | 10 ++-- helm/Chart.yaml | 4 +- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- helm/values.yaml | 4 +- ...yaml => p4pa-pagopa-payments.openapi.yaml} | 4 +- settings.gradle.kts | 2 +- .../PagoPaPaymentsApplication.java} | 6 +- .../pagopapayments}/config/SwaggerConfig.java | 2 +- .../gov/pagopa/template/utils/Calculator.java | 8 --- .../config/SwaggerConfigTest.java | 2 +- .../pagopa/template/utils/CalculatorTest.java | 31 ---------- 29 files changed, 109 insertions(+), 157 deletions(-) create mode 100644 .github/terraform/.terraform.lock.hcl delete mode 100644 .github/terraform/env/itn-dev/backend.ini delete mode 100644 .github/terraform/env/itn-dev/backend.tfvars delete mode 100644 .github/terraform/env/itn-dev/terraform.tfvars delete mode 100644 .github/terraform/env/itn-uat/backend.ini delete mode 100644 .github/terraform/env/itn-uat/backend.tfvars delete mode 100644 .github/terraform/env/itn-uat/terraform.tfvars rename openapi/{template-payments-java-repository.openapi.yaml => p4pa-pagopa-payments.openapi.yaml} (93%) rename src/main/java/it/gov/pagopa/{template/TemplateApplication.java => pu/pagopapayments/PagoPaPaymentsApplication.java} (57%) rename src/main/java/it/gov/pagopa/{template => pu/pagopapayments}/config/SwaggerConfig.java (95%) delete mode 100644 src/main/java/it/gov/pagopa/template/utils/Calculator.java rename src/test/java/it/gov/pagopa/{template => pu/pagopapayments}/config/SwaggerConfigTest.java (93%) delete mode 100644 src/test/java/it/gov/pagopa/template/utils/CalculatorTest.java diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6c08663..d27b613 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,2 @@ # Add the repository's code owners here -* @pagopa/p4pa-admins @pagopa/payments-cloud-admin +* @pagopa/p4pa-admins @pagopa/payments-cloud-admin @antocalo @Benedetta-fabbri @LarissaASLeite @RiccardoGiuliani @oleksiybozhykntt @ElisKina-dev diff --git a/.github/terraform/.terraform.lock.hcl b/.github/terraform/.terraform.lock.hcl new file mode 100644 index 0000000..d4f7c9c --- /dev/null +++ b/.github/terraform/.terraform.lock.hcl @@ -0,0 +1,45 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "3.117.0" + constraints = "~> 3.116" + hashes = [ + "h1:pAXy9cKU+bX1rvWog4YWeLbg7VFHqRTAFKbjayIXK1k=", + "zh:2e25f47492366821a786762369f0e0921cc9452d64bfd5075f6fdfcf1a9c6d70", + "zh:41eb34f2f7469bf3eb1019dfb0e7fc28256f809824016f4f8b9d691bf473b2ac", + "zh:48bb9c87b3d928da1abc1d3db75453c9725de4674c612daf3800160cc7145d30", + "zh:5d6b0de0bbd78943fcc65c53944ef4496329e247f434c6eab86ed051c5cea67b", + "zh:78c9f6fdb1206a89cf0e6706b4f46178169a93b6c964a4cad8a321058ccbd9b4", + "zh:793b702c352589d4360b580d4a1cf654a7439d2ad6bdb7bfea91de07bc4b0fac", + "zh:7ed687ff0a5509463a592f97431863574fe5cc80a34e395be06766215b8c6285", + "zh:955ba18789bd15592824eb426a8d0f38595bd09fffc6939c1c58933489c1a71e", + "zh:bf5949a55be0714cd9c8815d472eae4baa48ba06d0f6bf2b96775869acda8a54", + "zh:da5d31f635abd2c645ffc76d6176d73f646128e73720cc368247cc424975c127", + "zh:eed5a66d59883c9c56729b0a964a2b60d758ea7489ef3e920a6fbd48518ce5f5", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + ] +} + +provider "registry.terraform.io/integrations/github" { + version = "6.4.0" + constraints = "~> 6.3" + hashes = [ + "h1:YiGCvjr7R77HGTzw81legWicEHApVTli8O+ooDpLexE=", + "zh:00f431c2a2510efcb1115442dda5e90815bcb16e1a3301679ade0139fa963d3b", + "zh:12a862f4317b3cb65682c1b687650cd91eeee99e63774bdcfa8bcfc64bad097b", + "zh:226d5e09ff27f94cb9336089181d26f85cb30219b863a579597f2e107f37de49", + "zh:402ecaa5add568a52ee01d816810f3b90f693be35c680fcdc9b6284bf55326f1", + "zh:60e3bdd9fbefb3c1d790bc08889c1dc0e83636b82284faaa709411aa4f96bb9f", + "zh:625099eeff2f8aaecd22a24a451b326828435c8f9de86f2e5e99872e7b467fa7", + "zh:79e8b665421009df2260f50e10da1f7a7863b557ece96e2b07dfd2fad1e86fcd", + "zh:98e471fefc93dcfedeec750c694110db7d3331dc3a256191d30b9d2f70d12157", + "zh:a17702765e1fa92d1c288ddfd97075819ad61b344b341be7e09c554c841a6d9e", + "zh:ca72ccf40624ae26bf4660d8dd84a51638f0a1e78d5f19fdfaafaef97f838af6", + "zh:d009ab5527d45c44c424d26cd2eb51a5a6a6448f3fb1023b675789588cc08d64", + "zh:e5811be1e942a75b14dfcd3e03523d8df60cfbde0d7e24d75e78480a02a58949", + "zh:e6008ad28225ad6996b06bcd7f3070863329df406a56754e7fb9c31d6301ace4", + "zh:f1d93f56ea4f87183a5de4780704907605851d95a2d285a9ec755bf784c5569c", + "zh:fbd1fee2c9df3aa19cf8851ce134dea6e45ea01cb85695c1726670c285797e25", + ] +} diff --git a/.github/terraform/00_data.tf b/.github/terraform/00_data.tf index 83fd4f6..570396c 100644 --- a/.github/terraform/00_data.tf +++ b/.github/terraform/00_data.tf @@ -1,3 +1,9 @@ +# Github +data "github_organization_teams" "all" { + root_teams_only = true + summary_only = true +} + # KV Core data "azurerm_key_vault" "key_vault_core" { name = "${var.prefix}-${var.env_short}-${var.location_short}-core-kv" @@ -6,12 +12,22 @@ data "azurerm_key_vault" "key_vault_core" { # Kv Domain data "azurerm_key_vault" "key_vault_domain" { - name = "${var.prefix}-${var.env_short}-${var.location_short}-${var.domain}-kv" + name = "${var.prefix}-${var.env_short}-${var.domain}-kv" resource_group_name = "${var.prefix}-${var.env_short}-${var.location_short}-${var.domain}-sec-rg" } -# Github -data "github_organization_teams" "all" { - root_teams_only = true - summary_only = true +# Key Vault - Sonar Token +data "azurerm_key_vault_secret" "sonar_token" { + count = var.env_short == "p" ? 1 : 0 + + key_vault_id = data.azurerm_key_vault.key_vault_core.id + name = "sonar-cloud-token" +} + +# Key Vault - Slack webhok +data "azurerm_key_vault_secret" "slack_webhook" { + count = var.env_short == "p" ? 1 : 0 + + key_vault_id = data.azurerm_key_vault.key_vault_core.id + name = "slack-webhook-url" } diff --git a/.github/terraform/99_locals.tf b/.github/terraform/99_locals.tf index 835185d..6fb4185 100644 --- a/.github/terraform/99_locals.tf +++ b/.github/terraform/99_locals.tf @@ -4,28 +4,28 @@ locals { CreatedBy = "Terraform" Environment = var.env Owner = upper(var.prefix) - Source = "" # Repository URL - CostCenter = "" + Source = "https://github.com/pagopa/p4pa-pagopa-payments" # Repository URL + CostCenter = "TS310 - PAGAMENTI & SERVIZI" } # Repo github = { org = "pagopa" - repository = "" # Repository Name + repository = "p4pa-pagopa-payments" # Repository Name } - env_secrets = { - ENV_SECRET = "data.azurerm_key_vault_secret.CHANGE_ME.value" - } - env_variables = { - ENV_VARIABLE = "ENV_VARIABLE" - } + env_secrets = {} + env_variables = {} repo_secrets = var.env_short == "p" ? { - SECRET = "SECRET" + SONAR_TOKEN = data.azurerm_key_vault_secret.sonar_token[0].value + SLACK_WEBHOOK_URL = data.azurerm_key_vault_secret.slack_webhook[0].value } : {} + repo_env = var.env_short == "p" ? { - ENV_VARIABLE = "ENV_VARIABLE" + SONARCLOUD_PROJECT_NAME = "p4pa-pagopa-payments" + SONARCLOUD_PROJECT_KEY = "pagopa_p4pa-pagopa-payments" + SONARCLOUD_ORG = "pagopa" } : {} map_repo = { diff --git a/.github/terraform/99_variables.tf b/.github/terraform/99_variables.tf index 40485c1..59ef35e 100644 --- a/.github/terraform/99_variables.tf +++ b/.github/terraform/99_variables.tf @@ -48,6 +48,6 @@ variable "github_repository_environment" { default = { protected_branches = false custom_branch_policies = true - reviewers_teams = ["CHANGE_ME"] + reviewers_teams = ["p4pa-admins"] } } diff --git a/.github/terraform/env/itn-dev/backend.ini b/.github/terraform/env/itn-dev/backend.ini deleted file mode 100644 index 4939eae..0000000 --- a/.github/terraform/env/itn-dev/backend.ini +++ /dev/null @@ -1 +0,0 @@ -subscription=CHANGE_ME diff --git a/.github/terraform/env/itn-dev/backend.tfvars b/.github/terraform/env/itn-dev/backend.tfvars deleted file mode 100644 index 1cb6eb0..0000000 --- a/.github/terraform/env/itn-dev/backend.tfvars +++ /dev/null @@ -1,4 +0,0 @@ -resource_group_name = "terraform-state-rg" -storage_account_name = "tfappdevCHANGE_ME" -container_name = "terraform-state" -key = "NAME_OF_REPOSITORY.tfstate" diff --git a/.github/terraform/env/itn-dev/terraform.tfvars b/.github/terraform/env/itn-dev/terraform.tfvars deleted file mode 100644 index 20c2f49..0000000 --- a/.github/terraform/env/itn-dev/terraform.tfvars +++ /dev/null @@ -1,4 +0,0 @@ -prefix = "" -env = "dev" -env_short = "d" -location_short = "" diff --git a/.github/terraform/env/itn-prod/backend.ini b/.github/terraform/env/itn-prod/backend.ini index 4939eae..fad0ea2 100644 --- a/.github/terraform/env/itn-prod/backend.ini +++ b/.github/terraform/env/itn-prod/backend.ini @@ -1 +1 @@ -subscription=CHANGE_ME +subscription=PROD-P4PA diff --git a/.github/terraform/env/itn-prod/backend.tfvars b/.github/terraform/env/itn-prod/backend.tfvars index 1cb6eb0..2155b01 100644 --- a/.github/terraform/env/itn-prod/backend.tfvars +++ b/.github/terraform/env/itn-prod/backend.tfvars @@ -1,4 +1,4 @@ resource_group_name = "terraform-state-rg" -storage_account_name = "tfappdevCHANGE_ME" +storage_account_name = "tfappprodp4pa" container_name = "terraform-state" -key = "NAME_OF_REPOSITORY.tfstate" +key = "p4pa-pagopa-payments" diff --git a/.github/terraform/env/itn-prod/terraform.tfvars b/.github/terraform/env/itn-prod/terraform.tfvars index 26dd449..fdedbba 100644 --- a/.github/terraform/env/itn-prod/terraform.tfvars +++ b/.github/terraform/env/itn-prod/terraform.tfvars @@ -1,3 +1,5 @@ -prefix = "" -env = "prod" -env_short = "p" +prefix = "p4pa" +env = "prod" +env_short = "p" +domain = "payhub" +location_short = "itn" diff --git a/.github/terraform/env/itn-uat/backend.ini b/.github/terraform/env/itn-uat/backend.ini deleted file mode 100644 index 4939eae..0000000 --- a/.github/terraform/env/itn-uat/backend.ini +++ /dev/null @@ -1 +0,0 @@ -subscription=CHANGE_ME diff --git a/.github/terraform/env/itn-uat/backend.tfvars b/.github/terraform/env/itn-uat/backend.tfvars deleted file mode 100644 index 1cb6eb0..0000000 --- a/.github/terraform/env/itn-uat/backend.tfvars +++ /dev/null @@ -1,4 +0,0 @@ -resource_group_name = "terraform-state-rg" -storage_account_name = "tfappdevCHANGE_ME" -container_name = "terraform-state" -key = "NAME_OF_REPOSITORY.tfstate" diff --git a/.github/terraform/env/itn-uat/terraform.tfvars b/.github/terraform/env/itn-uat/terraform.tfvars deleted file mode 100644 index e46909e..0000000 --- a/.github/terraform/env/itn-uat/terraform.tfvars +++ /dev/null @@ -1,3 +0,0 @@ -prefix = "" -env = "uat" -env_short = "u" diff --git a/.github/workflows/codereview.yml b/.github/workflows/codereview.yml index 22616bd..2286342 100644 --- a/.github/workflows/codereview.yml +++ b/.github/workflows/codereview.yml @@ -1,4 +1,4 @@ -name: TEMPLATE-PAYMENTS - Code Review +name: p4pa-pagopa-payments - Code Review on: push: diff --git a/README.md b/README.md index 83abf99..039b0b3 100644 --- a/README.md +++ b/README.md @@ -1,56 +1 @@ -# Example Repository Template - -This repository serves as an **example template** to kick-start your projects with pre-configured files and folders for **OpenAPI**, **Helm**, **Gradle**, **Java**, and **JUnit testing**. It is designed to streamline the initial setup of new projects and ensure consistency in project structure. - ---- - -## 📂 Repository Structure - -Here is a quick overview of the files and directories included in this repository: - -```plaintext -. -├── .devops/ # DevOps pipelines -├── .github/ # GitHub configuration files -├── gradle/ # Gradle wrapper files -├── helm/ # Helm charts for Kubernetes deployments -├── openapi/ # OpenAPI specification files -├── src/ # Source code for the Java application -│ ├── main/ -│ └── test/ -├── build.gradle.kts # Gradle build file -├── Dockerfile # Docker build file -├── README.md # Project documentation -├── settings.gradle.kts # Gradle settings file -└── .gitignore # Git ignore rules -``` - -## 🚀 Features - -### 📜 OpenAPI -- Example OpenAPI specification file (`template-payments-java-repository.openapi.yaml`) to document your RESTful APIs. -- Compatible with tools like Swagger and Postman. - -### ⚙️ Helm -- Template Helm charts for deploying your Java application on Kubernetes. -- Includes `values.yaml` for parameter configuration and pre-defined deployment manifests. - -### 🔧 Gradle -- `build.gradle` file with dependencies and plugins for building, testing, and running your Java application. -- Compatible with Java 21+. - -### ☕ Java -- Example Java application structure with a simple `HelloWorld` class. - -### ✅ JUnit -- Example JUnit test cases under the `test/` directory to help you get started with unit testing. - ---- - -## 🛠️ Getting Started - -### Prerequisites -Ensure the following tools are installed on your machine: -1. **Java 21+** -2. **Gradle** (or use the Gradle wrapper included in the repository) -3. **Docker** (for Helm-related tasks, optional) +# p4pa-pagopa-payments diff --git a/build.gradle.kts b/build.gradle.kts index 99f206f..b9ff333 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ plugins { group = "it.gov.pagopa.payhub" version = "0.0.1" -description = "template-payments-java-repository" +description = "p4pa-pagopa-payments" java { toolchain { @@ -92,15 +92,15 @@ configure { } springBoot { - mainClass.value("it.gov.pagopa.template.TemplateApplication") + mainClass.value("it.gov.pagopa.pu.pagopapayments.PagoPaPaymentsApplication") } openApiGenerate { generatorName.set("spring") - inputSpec.set("$rootDir/openapi/template-payments-java-repository.openapi.yaml") + inputSpec.set("$rootDir/openapi/p4pa-pagopa-payments.openapi.yaml") outputDir.set("$projectDir/build/generated") - apiPackage.set("it.gov.pagopa.template.controller.generated") - modelPackage.set("it.gov.pagopa.template.dto.generated") + apiPackage.set("it.gov.pagopa.pu.pagopapayments.controller.generated") + modelPackage.set("it.gov.pagopa.pu.pagopapayments.dto.generated") configOptions.set(mapOf( "dateLibrary" to "java8", "requestMappingMode" to "api_interface", diff --git a/helm/Chart.yaml b/helm/Chart.yaml index bdec32b..e0d434c 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: template-payments-java-repository -description: TEMPLATE PAYMENTS JAVA REPOSITORY +name: p4pa-pagopa-payments +description: p4pa-pagopa-payments type: application version: 1.0.0 appVersion: 1.0.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 54229d4..9ff8bfd 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -1,6 +1,6 @@ microservice-chart: image: - repository: p4paditncorecommonacr.azurecr.io/templatepaymentsjavarepository + repository: p4paditncorecommonacr.azurecr.io/p4papagopapayments tag: latest pullPolicy: Always diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 4bee648..7f4bd09 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -1,6 +1,6 @@ microservice-chart: image: - repository: p4papitncorecommonacr.azurecr.io/templatepaymentsjavarepository + repository: p4papitncorecommonacr.azurecr.io/p4papagopapayments tag: latest pullPolicy: Always diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 05c9d0e..19ddfc2 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -1,6 +1,6 @@ microservice-chart: image: - repository: p4pauitncorecommonacr.azurecr.io/templatepaymentsjavarepository + repository: p4pauitncorecommonacr.azurecr.io/p4papagopapayments tag: latest pullPolicy: Always diff --git a/helm/values.yaml b/helm/values.yaml index d6396f8..be88a6c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -29,7 +29,7 @@ microservice-chart: ingress: create: true - path: /templatepaymentsjavarepository/(.*) + path: /p4papagopapayments/(.*) serviceAccount: create: false @@ -55,7 +55,7 @@ microservice-chart: key: applicationinsights.json envConfig: - APPLICATIONINSIGHTS_ROLE_NAME: "templatepaymentsjavarepository" + APPLICATIONINSIGHTS_ROLE_NAME: "p4pa-pagopa-payments" APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL: "OFF" APPLICATIONINSIGHTS_INSTRUMENTATION_MICROMETER_ENABLED: "false" APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLED: "false" diff --git a/openapi/template-payments-java-repository.openapi.yaml b/openapi/p4pa-pagopa-payments.openapi.yaml similarity index 93% rename from openapi/template-payments-java-repository.openapi.yaml rename to openapi/p4pa-pagopa-payments.openapi.yaml index 7f5b1c0..9684f23 100644 --- a/openapi/template-payments-java-repository.openapi.yaml +++ b/openapi/p4pa-pagopa-payments.openapi.yaml @@ -1,8 +1,8 @@ openapi: 3.1.0 info: - title: Fake API + title: p4pa-pagopa-payments description: "Sample API" - version: "1.0.0" + version: Api and Models paths: /api/v1/greet: get: diff --git a/settings.gradle.kts b/settings.gradle.kts index 5210869..a77e1a4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "template-payments-java-repository" +rootProject.name = "p4pa-pagopa-payments" diff --git a/src/main/java/it/gov/pagopa/template/TemplateApplication.java b/src/main/java/it/gov/pagopa/pu/pagopapayments/PagoPaPaymentsApplication.java similarity index 57% rename from src/main/java/it/gov/pagopa/template/TemplateApplication.java rename to src/main/java/it/gov/pagopa/pu/pagopapayments/PagoPaPaymentsApplication.java index 42b42d3..53bf3e8 100644 --- a/src/main/java/it/gov/pagopa/template/TemplateApplication.java +++ b/src/main/java/it/gov/pagopa/pu/pagopapayments/PagoPaPaymentsApplication.java @@ -1,13 +1,13 @@ -package it.gov.pagopa.template; +package it.gov.pagopa.pu.pagopapayments; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class TemplateApplication { +public class PagoPaPaymentsApplication { public static void main(String[] args) { - SpringApplication.run(TemplateApplication.class, args); + SpringApplication.run(PagoPaPaymentsApplication.class, args); } } diff --git a/src/main/java/it/gov/pagopa/template/config/SwaggerConfig.java b/src/main/java/it/gov/pagopa/pu/pagopapayments/config/SwaggerConfig.java similarity index 95% rename from src/main/java/it/gov/pagopa/template/config/SwaggerConfig.java rename to src/main/java/it/gov/pagopa/pu/pagopapayments/config/SwaggerConfig.java index 350b9a6..67e9456 100644 --- a/src/main/java/it/gov/pagopa/template/config/SwaggerConfig.java +++ b/src/main/java/it/gov/pagopa/pu/pagopapayments/config/SwaggerConfig.java @@ -1,4 +1,4 @@ -package it.gov.pagopa.template.config; +package it.gov.pagopa.pu.pagopapayments.config; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; diff --git a/src/main/java/it/gov/pagopa/template/utils/Calculator.java b/src/main/java/it/gov/pagopa/template/utils/Calculator.java deleted file mode 100644 index 5906f6c..0000000 --- a/src/main/java/it/gov/pagopa/template/utils/Calculator.java +++ /dev/null @@ -1,8 +0,0 @@ -package it.gov.pagopa.template.utils; - -public class Calculator { - - public int multiply(int a, int b) { - return a * b; - } -} diff --git a/src/test/java/it/gov/pagopa/template/config/SwaggerConfigTest.java b/src/test/java/it/gov/pagopa/pu/pagopapayments/config/SwaggerConfigTest.java similarity index 93% rename from src/test/java/it/gov/pagopa/template/config/SwaggerConfigTest.java rename to src/test/java/it/gov/pagopa/pu/pagopapayments/config/SwaggerConfigTest.java index af61c01..2a3a10b 100644 --- a/src/test/java/it/gov/pagopa/template/config/SwaggerConfigTest.java +++ b/src/test/java/it/gov/pagopa/pu/pagopapayments/config/SwaggerConfigTest.java @@ -1,4 +1,4 @@ -package it.gov.pagopa.template.config; +package it.gov.pagopa.pu.pagopapayments.config; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; diff --git a/src/test/java/it/gov/pagopa/template/utils/CalculatorTest.java b/src/test/java/it/gov/pagopa/template/utils/CalculatorTest.java deleted file mode 100644 index 2bba8fb..0000000 --- a/src/test/java/it/gov/pagopa/template/utils/CalculatorTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package it.gov.pagopa.template.utils; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.RepeatedTest; -import org.junit.jupiter.api.Test; - -class CalculatorTest { - Calculator calculator; - - @BeforeEach - void setUp() { - calculator = new Calculator(); - } - - @Test - @DisplayName("Simple multiplication should work") - void testMultiply() { - assertEquals(20, calculator.multiply(4, 5), - "Regular multiplication should work"); - } - - @RepeatedTest(5) - @DisplayName("Ensure correct handling of zero") - void testMultiplyWithZero() { - assertEquals(0, calculator.multiply(0, 5), "Multiple with zero should be zero"); - assertEquals(0, calculator.multiply(5, 0), "Multiple with zero should be zero"); - } -}