Search in sources :

Example 6 with IntygModuleFacadeException

use of se.inera.intyg.webcert.web.service.intyg.converter.IntygModuleFacadeException in project webcert by sklintyg.

the class IntygServiceRevokeTest method testRevokeIntygThatHasAlreadyBeenRevokedFails.

@Test(expected = WebCertServiceException.class)
public void testRevokeIntygThatHasAlreadyBeenRevokedFails() throws IntygModuleFacadeException {
    when(moduleFacade.getCertificate(anyString(), anyString())).thenThrow(new IntygModuleFacadeException(""));
    // Do the call
    try {
        intygService.revokeIntyg(INTYG_ID, INTYG_TYP_FK, REVOKE_MSG, REVOKE_REASON);
    } finally {
        verifyZeroInteractions(certificateSenderService);
        verify(intygRepository, times(0)).save(any(Utkast.class));
        verifyZeroInteractions(notificationService);
        verifyZeroInteractions(logService);
    }
}
Also used : Utkast(se.inera.intyg.webcert.persistence.utkast.model.Utkast) IntygModuleFacadeException(se.inera.intyg.webcert.web.service.intyg.converter.IntygModuleFacadeException) Test(org.junit.Test)

Aggregations

IntygModuleFacadeException (se.inera.intyg.webcert.web.service.intyg.converter.IntygModuleFacadeException)6 Test (org.junit.Test)3 WebCertServiceException (se.inera.intyg.webcert.common.service.exception.WebCertServiceException)3 IntygContentHolder (se.inera.intyg.webcert.web.service.intyg.dto.IntygContentHolder)3 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ModuleException (se.inera.intyg.common.support.modules.support.api.exception.ModuleException)2 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)2 IOException (java.io.IOException)1 LocalDateTime (java.time.LocalDateTime)1 ChronoLocalDateTime (java.time.chrono.ChronoLocalDateTime)1 WebServiceException (javax.xml.ws.WebServiceException)1 Patient (se.inera.intyg.common.support.model.common.internal.Patient)1 Utlatande (se.inera.intyg.common.support.model.common.internal.Utlatande)1 ModuleNotFoundException (se.inera.intyg.common.support.modules.registry.ModuleNotFoundException)1 ModuleApi (se.inera.intyg.common.support.modules.support.api.ModuleApi)1 CertificateResponse (se.inera.intyg.common.support.modules.support.api.dto.CertificateResponse)1 Personnummer (se.inera.intyg.schemas.contract.Personnummer)1 SekretessStatus (se.inera.intyg.webcert.common.model.SekretessStatus)1 CertificateSenderException (se.inera.intyg.webcert.web.service.certificatesender.CertificateSenderException)1 IntygPdf (se.inera.intyg.webcert.web.service.intyg.dto.IntygPdf)1