return true;
}
});
TaskListener listener = StreamTaskListener.fromStdout();
project.scheduleBuild2(0).get();
FailedTestsContent failedTestsContent = new FailedTestsContent();
failedTestsContent.onlyRegressions = true;
String content = failedTestsContent.evaluate(project.getLastBuild(), listener, FailedTestsContent.MACRO_NAME);
assertTrue("The failing test should be reported the first time it fails", content.contains("hudson.plugins.emailext"));
project.scheduleBuild2(0).get();
content = failedTestsContent.evaluate(project.getLastBuild(), listener, FailedTestsContent.MACRO_NAME);
assertFalse("The failing test should not be reported the second time it fails", content.contains("hudson.plugins.emailext"));
assertTrue("The content should state that there are other failing tests still", content.contains("and 1 other failed test"));
}