AllComponentsImplementedChecker extends Checker { @Override public String getViolationMessage() { return getViolationMessages().isEmpty() ? null : (getViolationMessages().size() + " components without corresponding classes: " + getViolationMessages()); } AllComponentsImplementedChecker(DependencyGraph dependencyGraph, Architecture architecture); @Override String getViolationMessage();  }
@Test public void testIsOk() { init(false, false); AllComponentsImplementedChecker check = new AllComponentsImplementedChecker(architectureGraph, packageArchitecture); assertThat(check.isOk(), is(true)); assertThat(check.getViolationMessages(), hasSize(0)); assertThat(check.getViolationMessage(), nullValue()); }
@Test public void testWithUnImplementedComponents() { init(false, true); AllComponentsImplementedChecker check = new AllComponentsImplementedChecker(architectureGraph, packageArchitecture); assertThat(check.isOk(), is(false)); assertThat(check.getViolationMessages(), hasSize(1)); assertThat(check.getViolationMessages().get(0), is("Another")); assertThat(check.getViolationMessage(), is("1 components without corresponding classes: [Another]")); }