TrustedServiceQCStatementConsistency implements TrustedServiceCondition { @Override public boolean isConsistent(TrustedServiceWrapper trustedService) { List<String> capturedQualifiers = trustedService.getCapturedQualifiers(); boolean qcStatement = ServiceQualification.isQcStatement(capturedQualifiers); boolean notQualified = ServiceQualification.isNotQualified(capturedQualifiers); if (qcStatement) { return !notQualified; } return true; }  @Override boolean isConsistent(TrustedServiceWrapper trustedService);  }
@Test public void testEmpty() { TrustedServiceWrapper service = new TrustedServiceWrapper(); assertTrue(condition.isConsistent(service)); }
@Test public void testQCStatementOnly() { TrustedServiceWrapper service = new TrustedServiceWrapper(); service.setCapturedQualifiers(Arrays.asList(ServiceQualification.QC_STATEMENT)); assertTrue(condition.isConsistent(service)); }
@Test public void testNoQualifiedOnly() { TrustedServiceWrapper service = new TrustedServiceWrapper(); service.setCapturedQualifiers(Arrays.asList(ServiceQualification.NOT_QUALIFIED)); assertTrue(condition.isConsistent(service)); }
@Test public void testConflict() { TrustedServiceWrapper service = new TrustedServiceWrapper(); service.setCapturedQualifiers(Arrays.asList(ServiceQualification.NOT_QUALIFIED, ServiceQualification.QC_STATEMENT)); assertFalse(condition.isConsistent(service)); }