@Test(expected = WebCertServiceException.class) public void testVerifyIsSentFilledList(){ CertificateResponse certificate = mock(CertificateResponse.class); Utlatande myUtlatande = mock(Utlatande.class); CertificateMetaData metaData = mock(CertificateMetaData.class); List<Status> myList = new LinkedList<>(); myList.add(new Status(CertificateState.SENT, "target", LocalDateTime.now())); doReturn(metaData).when(certificate).getMetaData(); doReturn(myList).when(metaData).getStatus(); doReturn("123").when(myUtlatande).getId(); doReturn(myUtlatande).when(certificate).getUtlatande(); verifyIsNotSent(certificate, IntygOperation.SEND); }
public static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation) { if (intyg.getSkickadTillMottagare() != null && intyg.getSkickadTillMottagare().trim().length() > 0) { intygAlreadySentError(intyg.getIntygsId(), operation.getValue()); } }
IntygVerificationHelper { public static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation) { if (intyg.getSkickadTillMottagare() != null && intyg.getSkickadTillMottagare().trim().length() > 0) { intygAlreadySentError(intyg.getIntygsId(), operation.getValue()); } } }
IntygVerificationHelper { public static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation) { if (intyg.getSkickadTillMottagare() != null && intyg.getSkickadTillMottagare().trim().length() > 0) { intygAlreadySentError(intyg.getIntygsId(), operation.getValue()); } } private  IntygVerificationHelper(); }
IntygVerificationHelper { public static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation) { if (intyg.getSkickadTillMottagare() != null && intyg.getSkickadTillMottagare().trim().length() > 0) { intygAlreadySentError(intyg.getIntygsId(), operation.getValue()); } } private  IntygVerificationHelper(); static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotSent(final CertificateResponse certificate, final IntygServiceImpl.IntygOperation operation); static void verifyIsSigned(final IntygContentHolder intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsSigned(final Utkast intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsSigned(final CertificateResponse certificate, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotRevoked(final IntygContentHolder intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotRevoked(final Utkast intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotRevoked(final CertificateResponse certificate, final IntygServiceImpl.IntygOperation operation); }
IntygVerificationHelper { public static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation) { if (intyg.getSkickadTillMottagare() != null && intyg.getSkickadTillMottagare().trim().length() > 0) { intygAlreadySentError(intyg.getIntygsId(), operation.getValue()); } } private  IntygVerificationHelper(); static void verifyIsNotSent(final Utkast intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotSent(final CertificateResponse certificate, final IntygServiceImpl.IntygOperation operation); static void verifyIsSigned(final IntygContentHolder intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsSigned(final Utkast intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsSigned(final CertificateResponse certificate, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotRevoked(final IntygContentHolder intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotRevoked(final Utkast intyg, final IntygServiceImpl.IntygOperation operation); static void verifyIsNotRevoked(final CertificateResponse certificate, final IntygServiceImpl.IntygOperation operation);  }