@Test public void removes_duplicate_onTestFound_events() { normalizer.onTestFound(TestId.ROOT, "root"); normalizer.onTestFound(TestId.ROOT, "root"); verify(target, times(1)).onTestFound(testFile, TestId.ROOT, "root"); verifyNoMoreInteractions(target); }
@Override public void onTestFound(TestId testId, String name) { if (hasNotBeenFoundBefore(testId)) { checkParentWasFoundFirst(testId); rememberFoundTest(testId, name); listener.onTestFound(testFile, testId, name); } else { checkNameIsSameAsBefore(testId, name); } }
RunEventNormalizer implements RunListener { @Override public void onTestFound(TestId testId, String name) { if (hasNotBeenFoundBefore(testId)) { checkParentWasFoundFirst(testId); rememberFoundTest(testId, name); listener.onTestFound(testFile, testId, name); } else { checkNameIsSameAsBefore(testId, name); } } }
RunEventNormalizer implements RunListener { @Override public void onTestFound(TestId testId, String name) { if (hasNotBeenFoundBefore(testId)) { checkParentWasFoundFirst(testId); rememberFoundTest(testId, name); listener.onTestFound(testFile, testId, name); } else { checkNameIsSameAsBefore(testId, name); } } RunEventNormalizer(SuiteListener listener, TestFile testFile); }
RunEventNormalizer implements RunListener { @Override public void onTestFound(TestId testId, String name) { if (hasNotBeenFoundBefore(testId)) { checkParentWasFoundFirst(testId); rememberFoundTest(testId, name); listener.onTestFound(testFile, testId, name); } else { checkNameIsSameAsBefore(testId, name); } } RunEventNormalizer(SuiteListener listener, TestFile testFile); @Override String toString(); @Override void onTestFound(TestId testId, String name); @Override void onInternalError(String message, Throwable cause); @Override void onRunStarted(RunId runId); @Override void onTestStarted(RunId runId, TestId testId); @Override void onPrintedOut(RunId runId, String text); @Override void onPrintedErr(RunId runId, String text); @Override void onFailure(RunId runId, TestId testId, Throwable cause); @Override void onTestFinished(RunId runId, TestId testId); @Override void onRunFinished(RunId runId); }
RunEventNormalizer implements RunListener { @Override public void onTestFound(TestId testId, String name) { if (hasNotBeenFoundBefore(testId)) { checkParentWasFoundFirst(testId); rememberFoundTest(testId, name); listener.onTestFound(testFile, testId, name); } else { checkNameIsSameAsBefore(testId, name); } } RunEventNormalizer(SuiteListener listener, TestFile testFile); @Override String toString(); @Override void onTestFound(TestId testId, String name); @Override void onInternalError(String message, Throwable cause); @Override void onRunStarted(RunId runId); @Override void onTestStarted(RunId runId, TestId testId); @Override void onPrintedOut(RunId runId, String text); @Override void onPrintedErr(RunId runId, String text); @Override void onFailure(RunId runId, TestId testId, Throwable cause); @Override void onTestFinished(RunId runId, TestId testId); @Override void onRunFinished(RunId runId);  }