Skip to content

Commit

Permalink
Merge branch 'main' into P4ADEV-1633-classify-iuv-activity-retrieve-t…
Browse files Browse the repository at this point in the history
…es-iuf
  • Loading branch information
silvanotamburini authored Jan 2, 2025
2 parents ac7fb32 + e3f0343 commit b2b824e
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 65 deletions.
20 changes: 9 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar

plugins {
java
id("org.springframework.boot") version "3.4.0"
id("io.spring.dependency-management") version "1.1.6"
id("org.sonarqube") version "5.0.0.4638"
id("org.springframework.boot") version "3.4.1"
id("io.spring.dependency-management") version "1.1.7"
id("org.sonarqube") version "6.0.1.5171"
`java-library`
`maven-publish`
jacoco
id("com.intershop.gradle.jaxb") version "7.0.0"
id("org.openapi.generator") version "7.9.0"
id("com.intershop.gradle.jaxb") version "7.0.1"
id("org.openapi.generator") version "7.10.0"
}

group = "it.gov.pagopa.payhub"
Expand Down Expand Up @@ -49,16 +49,15 @@ tasks.jacocoTestReport {
apply(plugin = "maven-publish")

val janinoVersion = "3.1.12"
val snakeYamlVersion = "2.0"
val hibernateValidatorVersion = "8.0.1.Final"
val hibernateValidatorVersion = "8.0.2.Final"
val commonsCompressVersion = "1.27.1"
val commonsLang3Version = "3.17.0"
val commonsTextVersion = "1.12.0"
val jacksonModuleVersion = "2.18.1"
val commonsTextVersion = "1.13.0"
val jacksonModuleVersion = "2.18.2"
val activationVersion = "2.1.3"
val jaxbVersion = "4.0.5"
val jaxbApiVersion = "4.0.2"
val jsoupVersion = "1.18.1"
val jsoupVersion = "1.18.3"
val openApiToolsVersion = "0.2.6"
val temporalVersion = "1.27.0"
val protobufJavaVersion = "3.25.5"
Expand All @@ -77,7 +76,6 @@ dependencies {
implementation("org.apache.commons:commons-text:$commonsTextVersion")

// Security fixes
implementation("org.yaml:snakeyaml:$snakeYamlVersion")
implementation("com.google.protobuf:protobuf-java:$protobufJavaVersion")

implementation("com.fasterxml.jackson.module:jackson-module-parameter-names:$jacksonModuleVersion")
Expand Down
74 changes: 37 additions & 37 deletions gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# This file is expected to be part of source control.
ch.qos.logback:logback-classic:1.5.12=compileClasspath
ch.qos.logback:logback-core:1.5.12=compileClasspath
com.fasterxml.jackson.core:jackson-annotations:2.18.1=compileClasspath
com.fasterxml.jackson.core:jackson-core:2.18.1=compileClasspath
com.fasterxml.jackson.core:jackson-databind:2.18.1=compileClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.1=compileClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1=compileClasspath
com.fasterxml.jackson.module:jackson-module-parameter-names:2.18.1=compileClasspath
com.fasterxml.jackson:jackson-bom:2.18.1=compileClasspath
com.fasterxml.jackson.core:jackson-annotations:2.18.2=compileClasspath
com.fasterxml.jackson.core:jackson-core:2.18.2=compileClasspath
com.fasterxml.jackson.core:jackson-databind:2.18.2=compileClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2=compileClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2=compileClasspath
com.fasterxml.jackson.module:jackson-module-parameter-names:2.18.2=compileClasspath
com.fasterxml.jackson:jackson-bom:2.18.2=compileClasspath
com.fasterxml:classmate:1.7.0=compileClasspath
com.google.api.grpc:proto-google-common-protos:2.9.0=compileClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath
Expand Down Expand Up @@ -38,9 +38,9 @@ io.grpc:grpc-protobuf:1.54.1=compileClasspath
io.grpc:grpc-services:1.54.1=compileClasspath
io.grpc:grpc-stub:1.54.1=compileClasspath
io.micrometer:micrometer-bom:1.9.9=compileClasspath
io.micrometer:micrometer-commons:1.14.1=compileClasspath
io.micrometer:micrometer-core:1.14.1=compileClasspath
io.micrometer:micrometer-observation:1.14.1=compileClasspath
io.micrometer:micrometer-commons:1.14.2=compileClasspath
io.micrometer:micrometer-core:1.14.2=compileClasspath
io.micrometer:micrometer-observation:1.14.2=compileClasspath
io.nexusrpc:nexus-sdk:0.3.0-alpha=compileClasspath
io.temporal:temporal-sdk:1.27.0=compileClasspath
io.temporal:temporal-serviceclient:1.27.0=compileClasspath
Expand All @@ -50,40 +50,40 @@ jakarta.validation:jakarta.validation-api:3.0.2=compileClasspath
jakarta.xml.bind:jakarta.xml.bind-api:4.0.2=compileClasspath
org.apache.commons:commons-compress:1.27.1=compileClasspath
org.apache.commons:commons-lang3:3.17.0=compileClasspath
org.apache.commons:commons-text:1.12.0=compileClasspath
org.apache.logging.log4j:log4j-api:2.24.1=compileClasspath
org.apache.logging.log4j:log4j-to-slf4j:2.24.1=compileClasspath
org.apache.tomcat.embed:tomcat-embed-core:10.1.33=compileClasspath
org.apache.tomcat.embed:tomcat-embed-el:10.1.33=compileClasspath
org.apache.tomcat.embed:tomcat-embed-websocket:10.1.33=compileClasspath
org.apache.commons:commons-text:1.13.0=compileClasspath
org.apache.logging.log4j:log4j-api:2.24.3=compileClasspath
org.apache.logging.log4j:log4j-to-slf4j:2.24.3=compileClasspath
org.apache.tomcat.embed:tomcat-embed-core:10.1.34=compileClasspath
org.apache.tomcat.embed:tomcat-embed-el:10.1.34=compileClasspath
org.apache.tomcat.embed:tomcat-embed-websocket:10.1.34=compileClasspath
org.checkerframework:checker-qual:3.43.0=compileClasspath
org.codehaus.janino:commons-compiler:3.1.12=compileClasspath
org.codehaus.janino:janino:3.1.12=compileClasspath
org.eclipse.angus:jakarta.mail:2.0.3=compileClasspath
org.hibernate.validator:hibernate-validator:8.0.1.Final=compileClasspath
org.hibernate.validator:hibernate-validator:8.0.2.Final=compileClasspath
org.jboss.logging:jboss-logging:3.6.1.Final=compileClasspath
org.jsoup:jsoup:1.18.1=compileClasspath
org.jsoup:jsoup:1.18.3=compileClasspath
org.openapitools:jackson-databind-nullable:0.2.6=compileClasspath
org.projectlombok:lombok:1.18.36=compileClasspath
org.slf4j:jul-to-slf4j:2.0.16=compileClasspath
org.slf4j:slf4j-api:2.0.16=compileClasspath
org.springframework.boot:spring-boot-autoconfigure:3.4.0=compileClasspath
org.springframework.boot:spring-boot-starter-json:3.4.0=compileClasspath
org.springframework.boot:spring-boot-starter-logging:3.4.0=compileClasspath
org.springframework.boot:spring-boot-starter-mail:3.4.0=compileClasspath
org.springframework.boot:spring-boot-starter-tomcat:3.4.0=compileClasspath
org.springframework.boot:spring-boot-starter-web:3.4.0=compileClasspath
org.springframework.boot:spring-boot-starter:3.4.0=compileClasspath
org.springframework.boot:spring-boot:3.4.0=compileClasspath
org.springframework.retry:spring-retry:2.0.10=compileClasspath
org.springframework:spring-aop:6.2.0=compileClasspath
org.springframework:spring-beans:6.2.0=compileClasspath
org.springframework:spring-context-support:6.2.0=compileClasspath
org.springframework:spring-context:6.2.0=compileClasspath
org.springframework:spring-core:6.2.0=compileClasspath
org.springframework:spring-expression:6.2.0=compileClasspath
org.springframework:spring-jcl:6.2.0=compileClasspath
org.springframework:spring-web:6.2.0=compileClasspath
org.springframework:spring-webmvc:6.2.0=compileClasspath
org.yaml:snakeyaml:2.0=compileClasspath
org.springframework.boot:spring-boot-autoconfigure:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-json:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-logging:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-mail:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-tomcat:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-web:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter:3.4.1=compileClasspath
org.springframework.boot:spring-boot:3.4.1=compileClasspath
org.springframework.retry:spring-retry:2.0.11=compileClasspath
org.springframework:spring-aop:6.2.1=compileClasspath
org.springframework:spring-beans:6.2.1=compileClasspath
org.springframework:spring-context-support:6.2.1=compileClasspath
org.springframework:spring-context:6.2.1=compileClasspath
org.springframework:spring-core:6.2.1=compileClasspath
org.springframework:spring-expression:6.2.1=compileClasspath
org.springframework:spring-jcl:6.2.1=compileClasspath
org.springframework:spring-web:6.2.1=compileClasspath
org.springframework:spring-webmvc:6.2.1=compileClasspath
org.yaml:snakeyaml:2.3=compileClasspath
empty=
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ public interface IngestionFlowFileDao {
*/
Optional<IngestionFlowFileDTO> findById(Long ingestionFlowFileId);

/**
*
* @param ingestionFlowFileId ingestionFlowFileId the unique identifier of the ingestion flow to be retrieved.
* @return String url of the error file
*/
String findErrorFileUrl(Long ingestionFlowFileId);

/**
* update ingestion flow file status
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void whenGetAccessTokenThenInvokeAccessTokenRetriever(){
// Given
String expectedResult = "TOKEN";
Mockito.when(accessTokenRetrieverMock.getAccessToken())
.thenReturn(AccessToken.builder().accessToken(expectedResult).build());
.thenReturn(AccessToken.builder().accessToken(expectedResult).tokenType("TOKENTYPE").expiresIn(0).build());

// When
String result = authnService.getAccessToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ void givenEmptyCacheWhenGetAccessTokenThenInvokeAndCache(){
// Given
AccessToken expectedResult = AccessToken.builder()
.expiresIn(10)
.accessToken("ACCESSTOKEN")
.tokenType("TOKENTYPE")
.build();

// When
Expand All @@ -53,6 +55,8 @@ void givenExpiredCacheWhenGetAccessTokenThenInvokeAndCache(){
// Given
AccessToken expectedResult = AccessToken.builder()
.expiresIn(5)
.accessToken("ACCESSTOKEN")
.tokenType("TOKENTYPE")
.build();

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import it.gov.pagopa.payhub.activities.service.OrganizationService;
import it.gov.pagopa.payhub.activities.utility.faker.IngestionFlowFileFaker;
import it.gov.pagopa.payhub.activities.utility.faker.OrganizationFaker;
import it.gov.pagopa.payhub.activities.utility.faker.UserInfoFaker;
import it.gov.pagopa.pu.p4paauth.dto.generated.UserInfo;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -47,9 +48,7 @@ void givenNoOrganizationWhenConfigureThenOk() {
// Given
EmailDTO emailDTO = new EmailDTO();
IngestionFlowFileDTO ingestionFlowFileDTO = IngestionFlowFileFaker.buildIngestionFlowFileDTO();
UserInfo userInfo = UserInfo.builder()
.email("[email protected]")
.build();
UserInfo userInfo = UserInfoFaker.buildUserInfo();

Mockito.when(authzServiceMock.getOperatorInfo(ingestionFlowFileDTO.getMappedExternalUserId()))
.thenReturn(userInfo);
Expand All @@ -71,9 +70,7 @@ void givenOrganizationWithSameEmailWhenConfigureThenOk() {
// Given
EmailDTO emailDTO = new EmailDTO();
IngestionFlowFileDTO ingestionFlowFileDTO = IngestionFlowFileFaker.buildIngestionFlowFileDTO();
UserInfo userInfo = UserInfo.builder()
.email("[email protected]")
.build();
UserInfo userInfo = UserInfoFaker.buildUserInfo();
OrganizationDTO organizationDTO = OrganizationFaker.buildOrganizationDTO();
organizationDTO.setAdminEmail(userInfo.getEmail());

Expand All @@ -97,9 +94,7 @@ void givenOrganizationWithDifferentEmailWhenConfigureThenOk() {
// Given
EmailDTO emailDTO = new EmailDTO();
IngestionFlowFileDTO ingestionFlowFileDTO = IngestionFlowFileFaker.buildIngestionFlowFileDTO();
UserInfo userInfo = UserInfo.builder()
.email("[email protected]")
.build();
UserInfo userInfo = UserInfoFaker.buildUserInfo();
OrganizationDTO organizationDTO = OrganizationFaker.buildOrganizationDTO();

Mockito.when(authzServiceMock.getOperatorInfo(ingestionFlowFileDTO.getMappedExternalUserId()))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package it.gov.pagopa.payhub.activities.utility.faker;

import it.gov.pagopa.pu.p4paauth.dto.generated.UserInfo;
import it.gov.pagopa.pu.p4paauth.dto.generated.UserOrganizationRoles;

import java.util.List;

public class UserInfoFaker {

public static UserInfo buildUserInfo() {
return UserInfo.builder()
.userId("USERID")
.mappedExternalUserId("MAPPEDEXTERNALUSERID")
.fiscalCode("FISCALCODE")
.familyName("FAMILYNAME")
.name("NAME")
.email("[email protected]")
.issuer("ISSUER")
.organizations(List.of(UserOrganizationRoles.builder()
.operatorId("OPERATORID")
.organizationIpaCode("ORGIPACODE")
.roles(List.of("ROLE_ADMIN"))
.build()))
.build();
}
}

0 comments on commit b2b824e

Please sign in to comment.