diff --git a/src/test/java/it/finanze/sanita/fse2/ms/iniclient/IniInvocationTest.java b/src/test/java/it/finanze/sanita/fse2/ms/iniclient/IniInvocationTest.java index 68193b2e..ae46966b 100644 --- a/src/test/java/it/finanze/sanita/fse2/ms/iniclient/IniInvocationTest.java +++ b/src/test/java/it/finanze/sanita/fse2/ms/iniclient/IniInvocationTest.java @@ -11,6 +11,7 @@ */ package it.finanze.sanita.fse2.ms.iniclient; +import static it.finanze.sanita.fse2.ms.iniclient.controller.impl.IniOperationCTL.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -23,6 +24,7 @@ import javax.xml.bind.JAXBException; +import it.finanze.sanita.fse2.ms.iniclient.controller.impl.IniOperationCTL; import it.finanze.sanita.fse2.ms.iniclient.service.IConfigSRV; import org.bson.Document; import org.junit.jupiter.api.AfterEach; @@ -89,7 +91,7 @@ void dropCollection() { void publishSuccessTest() { Mockito.when(iniClient.sendPublicationData(any(DocumentEntryDTO.class), any(SubmissionSetEntryDTO.class), any(JWTTokenDTO.class))) .thenReturn(new RegistryResponseType()); - IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.PUBLISH,null); + IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.PUBLISH,null, VALID_REPOSITORY_TYPES.get(0)); assertTrue(response.getEsito()); assertNull(response.getMessage()); } @@ -99,7 +101,7 @@ void publishSuccessTest() { void publishErrorTest() { Mockito.when(iniClient.sendPublicationData(any(DocumentEntryDTO.class), any(SubmissionSetEntryDTO.class), any(JWTTokenDTO.class))) .thenThrow(new BusinessException("")); - assertThrows(BusinessException.class, () -> iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.PUBLISH,null)); + assertThrows(BusinessException.class, () -> iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.PUBLISH,null, VALID_REPOSITORY_TYPES.get(0))); } @Test @@ -108,7 +110,7 @@ void publishErrorResponseTest() { RegistryResponseType registryResponseType = TestUtility.mockRegistryError(); Mockito.when(iniClient.sendPublicationData(any(DocumentEntryDTO.class), any(SubmissionSetEntryDTO.class), any(JWTTokenDTO.class))) .thenReturn(registryResponseType); - IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.PUBLISH,null); + IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.PUBLISH,null, VALID_REPOSITORY_TYPES.get(0)); assertFalse(response.getEsito()); assertNotNull(response.getMessage()); } @@ -119,7 +121,7 @@ void replaceSuccessTest() { RegistryResponseType registryResponseType = TestUtility.mockRegistrySuccess(); Mockito.when(iniClient.sendReplaceData(any(), any(), any(),any())) .thenReturn(registryResponseType); - IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.REPLACE,null); + IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.REPLACE,null, VALID_REPOSITORY_TYPES.get(0)); assertTrue(response.getEsito()); assertNull(response.getMessage()); } @@ -131,7 +133,7 @@ void replaceErrorTest() { ReplaceRequestDTO requestDTO = new ReplaceRequestDTO(); requestDTO.setRiferimentoIni("identificativoDoc"); requestDTO.setWorkflowInstanceId(TestConstants.TEST_WII); - assertThrows(BusinessException.class, () -> iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.REPLACE,null)); + assertThrows(BusinessException.class, () -> iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.REPLACE,null, VALID_REPOSITORY_TYPES.get(0))); } @Test @@ -143,7 +145,7 @@ void replaceErrorResponseTest() { ReplaceRequestDTO requestDTO = new ReplaceRequestDTO(); requestDTO.setRiferimentoIni("identificativoDoc"); requestDTO.setWorkflowInstanceId(TestConstants.TEST_WII); - IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.REPLACE,null); + IniResponseDTO response = iniInvocationSRV.publishOrReplaceOnIni(TestConstants.TEST_WII, ProcessorOperationEnum.REPLACE,null, VALID_REPOSITORY_TYPES.get(0)); assertFalse(response.getEsito()); assertNotNull(response.getMessage()); }