Skip to content

Commit

Permalink
Merge pull request #2 from pagopa/NOD-674-fix-repo
Browse files Browse the repository at this point in the history
[NOD-674] Fix repo
  • Loading branch information
aomegax authored Jan 31, 2024
2 parents ccdd80a + 0d097fc commit a671c5c
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 22 deletions.
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# Template for Java Spring Microservice project

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TODO-set-your-id&metric=alert_status)](https://sonarcloud.io/dashboard?id=TODO-set-your-id)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=pagopa_pagopa-node-cfg-sync&metric=alert_status)](https://sonarcloud.io/dashboard?id=pagopa_pagopa-node-cfg-sync)
[![Integration Tests](https://github.com/pagopa/<TODO-repo>/actions/workflows/integration_test.yml/badge.svg?branch=main)](https://github.com/pagopa/<TODO-repo>/actions/workflows/integration_test.yml)

TODO: add a description

TODO: generate a index with this tool: https://ecotrust-canada.github.io/markdown-toc/

TODO: resolve all the TODOs in this template
Microservice to update configuration schema of Nodo dei Pagamenti

---

## Api Documentation 📖
## API Documentation 📖

See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/<TODO-repo>/main/openapi/openapi.json)
See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-node-cfg-sync/main/openapi/openapi.json)

---

## Technology Stack

- Java 11
- Java 17
- Spring Boot
- Spring Web
- Hibernate
- JPA
- ...
- TODO

---

Expand All @@ -51,7 +45,7 @@ from `./docker` directory

- git
- maven
- jdk-11
- jdk-17

### Run the project

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
app:
container_name: 'service' # TODO
container_name: 'node-cfg-sync'
image: ${image}
platform: linux/amd64
build:
Expand Down
25 changes: 24 additions & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
{}
{
"openapi" : "3.0.1",
"info" : {
"title" : "job-manager",
"description" : "Microservice to update configuration schema of Nodo dei Pagamenti",
"termsOfService" : "https://www.pagopa.gov.it/",
"version" : "0.0.0"
},
"servers" : [ {
"url" : "http://localhost",
"description" : "Generated server url"
} ],
"paths" : { },
"components" : {
"securitySchemes" : {
"ApiKey" : {
"type" : "apiKey",
"description" : "The API key to access this function app.",
"name" : "Ocp-Apim-Subscription-Key",
"in" : "header"
}
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.3.0.603</version>
<version>3.10.0.2594</version>
<executions>
<execution>
<phase>verify</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class ResponseValidator {
* @param joinPoint not used
* @param result the response to validate
*/
// TODO: set your package
@AfterReturning(pointcut = "execution(* it.gov.pagopa.microservice.controller.*.*(..))", returning = "result")

@AfterReturning(pointcut = "execution(* it.gov.pagopa.node.cfg_sync.controller.*.*(..))", returning = "result")
public void validateResponse(JoinPoint joinPoint, Object result) {
if (result instanceof ResponseEntity) {
validateResponse((ResponseEntity<?>) result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ public ResponseEntity<ProblemJson> handleDataIntegrityViolationException(
final DataIntegrityViolationException ex, final WebRequest request) {
ProblemJson errorResponse = null;

if (ex.getCause() instanceof ConstraintViolationException) {
String sqlState = ((ConstraintViolationException) ex.getCause()).getSQLState();
var errorCode = ((ConstraintViolationException) ex.getCause()).getSQLException()
.getErrorCode();
if (ex.getCause() instanceof ConstraintViolationException constraintViolationException) {
String sqlState = constraintViolationException.getSQLState();
var errorCode = constraintViolationException.getSQLException().getErrorCode();
// check the reason of ConstraintViolationException: is true if the object is referenced by a foreign key
// more info: https://docs.oracle.com/javadb/10.8.3.0/ref/rrefexcept71493.html
if (sqlState.equals(FOREIGN_KEY_VIOLATION)) {
Expand Down
8 changes: 7 additions & 1 deletion src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Info
info.properties.environment=test
info.application.artifactId=@project.artifactId@
info.application.name=@project.name@
info.application.version=@project.version@
info.application.description=@project.description@
info.properties.environment=${ENV:test}
# Server
server.servlet.context-path=/
# logging
logging.level.root=INFO
logging.level.it.gov.pagopa=INFO
Expand Down

0 comments on commit a671c5c

Please sign in to comment.