Trying to diagnose a test failure on Windows on CI.
java.lang.NullPointerException
at hudson.model.MyViewTest.testDoCreateItem(MyViewTest.java:88)
@@ -32,6 +32,7 @@ import hudson.security.GlobalMatrixAuthorizationStrategy;
import java.io.IOException;
import java.util.logging.Level;
import org.acegisecurity.context.SecurityContextHolder;
+import static org.hamcrest.Matchers.*;
import org.junit.Rule;
import org.jvnet.hudson.test.JenkinsRule;
import static org.junit.Assert.*;
@@ -85,7 +86,7 @@ public class MyViewTest {
itemType.click();
rule.submit(form);
Item item = rule.jenkins.getItem("job");
- assertTrue("View " + view.getDisplayName() + " should contain job " + item.getDisplayName(), view.getItems().contains(item));
+ assertThat(view.getItems(), contains(equalTo(item)));
}
@Test
