From 85a5718c8ad81208db8a5ddff8b8920c1b9b9a17 Mon Sep 17 00:00:00 2001 From: Giulia Tremolada Date: Wed, 17 Jan 2024 17:15:59 +0100 Subject: [PATCH] feat: add new unit test --- .../mscore/core/OnboardingServiceImplTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/test/java/it/pagopa/selfcare/mscore/core/OnboardingServiceImplTest.java b/core/src/test/java/it/pagopa/selfcare/mscore/core/OnboardingServiceImplTest.java index 033df8ce5..69935a930 100644 --- a/core/src/test/java/it/pagopa/selfcare/mscore/core/OnboardingServiceImplTest.java +++ b/core/src/test/java/it/pagopa/selfcare/mscore/core/OnboardingServiceImplTest.java @@ -1495,6 +1495,20 @@ void shouldOnboardingInstitution() { assertDoesNotThrow(() -> onboardingServiceImpl.onboardingInstitution(onboardingRequest, mock(SelfCareUser.class))); } + @Test + void shouldOnboardingInstitutionProdPagoPa() { + OnboardingInstitutionStrategy mockInstitutionStrategy = mock(OnboardingInstitutionStrategy.class); + when(institutionStrategyFactory.retrieveOnboardingInstitutionStrategy(any(), any(), any())) + .thenReturn(mockInstitutionStrategy); + doNothing().when(mockInstitutionStrategy).onboardingInstitution(any(),any()); + + OnboardingRequest onboardingRequest = new OnboardingRequest(); + onboardingRequest.setProductId(ProductId.PROD_PAGOPA.getValue()); + onboardingRequest.setInstitutionUpdate(TestUtils.createSimpleInstitutionUpdate()); + + assertDoesNotThrow(() -> onboardingServiceImpl.onboardingInstitution(onboardingRequest, mock(SelfCareUser.class))); + } + @ParameterizedTest @ValueSource(strings = {"ipa", "regulatedMarket", "establishedByRegulatoryProvision", "agentOfPublicService"}) void shouldOnboardingInstitutionWithAdditionalInfo(String type) {