Search in sources :

Example 11 with BlueTestResult

use of io.jenkins.blueocean.rest.model.BlueTestResult in project blueocean-plugin by jenkinsci.

the class BlueTestResultContainerImplTest method testsFilteredExistingFailures.

@Test
public void testsFilteredExistingFailures() throws Exception {
    List<BlueTestResult> allResults = IteratorUtils.toList(container.iterator());
    List<BlueTestResult> allNew = IteratorUtils.toList(container.getBlueTestResultIterator(allResults, Status.FAILED.name(), null, "2"));
    assertEquals(1, allNew.size());
    for (BlueTestResult tr : allNew) {
        assertEquals(Status.FAILED, tr.getStatus());
        assertThat(tr.getAge(), greaterThan(2));
    }
}
Also used : BlueTestResult(io.jenkins.blueocean.rest.model.BlueTestResult) Test(org.junit.Test)

Aggregations

BlueTestResult (io.jenkins.blueocean.rest.model.BlueTestResult)11 BadRequestException (io.jenkins.blueocean.commons.ServiceException.BadRequestException)4 NotFoundException (io.jenkins.blueocean.commons.ServiceException.NotFoundException)4 Result (io.jenkins.blueocean.rest.factory.BlueTestResultFactory.Result)4 Test (org.junit.Test)4 NonNull (edu.umd.cs.findbugs.annotations.NonNull)3 State (io.jenkins.blueocean.rest.model.BlueTestResult.State)3 Status (io.jenkins.blueocean.rest.model.BlueTestResult.Status)3 StaplerRequest (org.kohsuke.stapler.StaplerRequest)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 Nullable (edu.umd.cs.findbugs.annotations.Nullable)2 Run (hudson.model.Run)2 IterableUtils (io.jenkins.blueocean.commons.IterableUtils)2 Reachable (io.jenkins.blueocean.rest.Reachable)2 BlueTestResultFactory (io.jenkins.blueocean.rest.factory.BlueTestResultFactory)2 BlueTestResultContainer (io.jenkins.blueocean.rest.model.BlueTestResultContainer)2 Iterator (java.util.Iterator)2 Predicate (java.util.function.Predicate)2 StreamSupport (java.util.stream.StreamSupport)2 StringUtils (org.apache.commons.lang.StringUtils)2