Skip to content

Commit

Permalink
Fixed unused param
Browse files Browse the repository at this point in the history
  • Loading branch information
giampieroferrara committed Jan 15, 2025
1 parent 8addb66 commit 1af6b3a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public Uni<OnboardingResponse> onboardingPaCompletion(@Valid OnboardingPaRequest
public Uni<OnboardingResponse> onboardingPaImport(@Valid OnboardingImportRequest onboardingRequest, @Context SecurityContext ctx) {
return readUserIdFromToken(ctx)
.onItem().transformToUni(userId -> onboardingService
.onboardingImport(fillUserId(onboardingMapper.toEntity(onboardingRequest), userId), onboardingRequest.getUsers(), onboardingRequest.getContractImported(), onboardingRequest.isForceImport()));
.onboardingImport(fillUserId(onboardingMapper.toEntity(onboardingRequest), userId), onboardingRequest.getUsers(), onboardingRequest.getContractImported()));
}

@Operation(
Expand All @@ -238,7 +238,7 @@ public Uni<OnboardingResponse> onboardingPaImport(@Valid OnboardingImportRequest
public Uni<OnboardingResponse> onboardingPspImport(@Valid OnboardingImportPspRequest onboardingRequest, @Context SecurityContext ctx) {
return readUserIdFromToken(ctx)
.onItem().transformToUni(userId -> onboardingService
.onboardingImport(fillUserId(onboardingMapper.toEntity(onboardingRequest), userId), List.of(), onboardingRequest.getContractImported(), false));
.onboardingImport(fillUserId(onboardingMapper.toEntity(onboardingRequest), userId), List.of(), onboardingRequest.getContractImported()));
}

@Operation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Uni<OnboardingResponse> onboardingUsers(
Uni<OnboardingResponse> onboardingImport(
Onboarding onboarding,
List<UserRequest> userRequests,
OnboardingImportContract contractImported,
boolean forceImport);
OnboardingImportContract contractImported);

Uni<OnboardingResponse> onboardingCompletion(
Onboarding onboarding, List<UserRequest> userRequests);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public Uni<OnboardingResponse> onboardingAggregationImport(
onboarding.setStatus(OnboardingStatus.PENDING);

return fillUsersAndOnboardingForImport(
onboarding, userRequests, aggregates, contractImported, TIMEOUT_ORCHESTRATION_RESPONSE, false);
onboarding, userRequests, aggregates, contractImported);
}


Expand All @@ -311,11 +311,11 @@ public Uni<OnboardingResponse> onboardingAggregationImport(
public Uni<OnboardingResponse> onboardingImport(
Onboarding onboarding,
List<UserRequest> userRequests,
OnboardingImportContract contractImported, boolean forceImport) {
OnboardingImportContract contractImported) {
onboarding.setWorkflowType(WorkflowType.IMPORT);
onboarding.setStatus(OnboardingStatus.PENDING);
return fillUsersAndOnboardingForImport(
onboarding, userRequests, null, contractImported, TIMEOUT_ORCHESTRATION_RESPONSE, forceImport);
onboarding, userRequests, null, contractImported);
}

/**
Expand Down Expand Up @@ -452,15 +452,18 @@ private Uni<OnboardingResponse> verifyExistingOnboarding(
}

/**
* @param timeout The orchestration instances will try complete within the defined timeout and the response is delivered synchronously. If is null
* the timeout is default 1 sec and the response is delivered asynchronously
*
* @param onboarding
* @param userRequests
* @param aggregateRequests
* @param contractImported
* @return OnboardingResponse
*/
private Uni<OnboardingResponse> fillUsersAndOnboardingForImport(
Onboarding onboarding,
List<UserRequest> userRequests,
List<AggregateInstitutionRequest> aggregateRequests,
OnboardingImportContract contractImported,
String timeout, boolean forceImport) {
OnboardingImportContract contractImported) {

onboarding.setCreatedAt(LocalDateTime.now());

Expand Down Expand Up @@ -509,7 +512,7 @@ private Uni<OnboardingResponse> fillUsersAndOnboardingForImport(
persistAndStartOrchestrationOnboarding(
currentOnboarding,
orchestrationApi.apiStartOnboardingOrchestrationGet(
currentOnboarding.getId(), timeout)))
currentOnboarding.getId(), TIMEOUT_ORCHESTRATION_RESPONSE)))
.onItem()
.transform(onboardingMapper::toResponse));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.times;
Expand Down Expand Up @@ -763,7 +762,7 @@ void onboardingImport() {

OnboardingImportRequest onboardingImportRequest = dummyOnboardingImport();

Mockito.when(onboardingService.onboardingImport(any(), any(), any(), anyBoolean()))
Mockito.when(onboardingService.onboardingImport(any(), any(), any()))
.thenReturn(Uni.createFrom().item(new OnboardingResponse()));

given()
Expand All @@ -775,7 +774,7 @@ void onboardingImport() {
.statusCode(200);

Mockito.verify(onboardingService, times(1))
.onboardingImport(any(), any(), any(), anyBoolean());
.onboardingImport(any(), any(), any());
}

@Test
Expand All @@ -797,7 +796,7 @@ void onboardingImportPSP() {

OnboardingImportPspRequest onboardingImportRequest = dummyOnboardingPspRequest();

Mockito.when(onboardingService.onboardingImport(any(), any(), any(), anyBoolean()))
Mockito.when(onboardingService.onboardingImport(any(), any(), any()))
.thenReturn(Uni.createFrom().item(new OnboardingResponse()));

given()
Expand All @@ -809,7 +808,7 @@ void onboardingImportPSP() {
.statusCode(200);

Mockito.verify(onboardingService, times(1))
.onboardingImport(any(), any(), any(), anyBoolean());
.onboardingImport(any(), any(), any());
}

@Test
Expand All @@ -819,7 +818,7 @@ void onboardingImportPSP_with_activatedAt() {
OnboardingImportPspRequest onboardingImportRequest = dummyOnboardingPspRequest();
onboardingImportRequest.getContractImported().setActivatedAt(LocalDateTime.now());

Mockito.when(onboardingService.onboardingImport(any(), any(), any(), anyBoolean()))
Mockito.when(onboardingService.onboardingImport(any(), any(), any()))
.thenReturn(Uni.createFrom().item(new OnboardingResponse()));

given()
Expand All @@ -831,7 +830,7 @@ void onboardingImportPSP_with_activatedAt() {
.statusCode(200);

Mockito.verify(onboardingService, times(1))
.onboardingImport(any(), any(), any(), anyBoolean());
.onboardingImport(any(), any(), any());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,7 @@ void onboarding_Onboarding_importPA(UniAsserter asserter) {
asserter.execute(() -> when(geographicTaxonomiesApi.retrieveGeoTaxonomiesByCodeUsingGET(any()))
.thenReturn(Uni.createFrom().item(geographicTaxonomyResource)));

asserter.assertThat(() -> onboardingService.onboardingImport(request, users, contractImported, false), Assertions::assertNotNull);
asserter.assertThat(() -> onboardingService.onboardingImport(request, users, contractImported), Assertions::assertNotNull);

asserter.execute(() -> {
PanacheMock.verify(Onboarding.class).persist(any(Onboarding.class), any());
Expand Down Expand Up @@ -2128,7 +2128,7 @@ void onboarding_Onboarding_importPSP(UniAsserter asserter) {
mockVerifyOnboardingNotFound();
mockVerifyAllowedMap(request.getInstitution().getTaxCode(), request.getProductId(), asserter);

asserter.assertThat(() -> onboardingService.onboardingImport(request, List.of(), contractImported, false), Assertions::assertNotNull);
asserter.assertThat(() -> onboardingService.onboardingImport(request, List.of(), contractImported), Assertions::assertNotNull);

asserter.execute(() -> {
PanacheMock.verify(Onboarding.class).persist(any(Onboarding.class), any());
Expand Down

0 comments on commit 1af6b3a

Please sign in to comment.