NotificationServiceImpl implements NotificationService { @Override public boolean checkConsentReviewStatus(Set<Consent> consents) { if (consents.size() == 0) return false; for (Consent consent : consents) { if (consent.getSignedPdfConsent() != null) return true; } return false; } NotificationServiceImpl(PatientRepository patientRepository); @Override String notificationStage(String username, String notify); @Override boolean checkConsentReviewStatus(Set<Consent> consents); @Override boolean checkConsentSignedStatus(Set<Consent> consents); @Override String notificationValuesetMgmt(String username, String notify,
			String message);  }
@Test public void testcheckConsentReviewStatus_when_consent_size_0() { Set<Consent> consents = new HashSet<Consent>(); boolean result = nst.checkConsentReviewStatus(consents); assertEquals(false, result); }
@Test public void testcheckConsentReviewStatus_when_consent_has_not_reviewed() { Set<Consent> consents = new HashSet<Consent>(); Consent consent = mock(Consent.class); consents.add(consent); when(consent.getSignedPdfConsent()).thenReturn(null); boolean result = nst.checkConsentReviewStatus(consents); assertEquals(false, result); }
@Test public void testcheckConsentReviewStatus_when_consent_has_reviewed() { Set<Consent> consents = new HashSet<Consent>(); Consent consent = mock(Consent.class); SignedPDFConsent signedPdfConsent = mock(SignedPDFConsent.class); consents.add(consent); when(consent.getSignedPdfConsent()).thenReturn(signedPdfConsent); boolean result = nst.checkConsentReviewStatus(consents); assertEquals(true, result); }