diff --git a/src/test/java/au/com/centrumsystems/hudson/plugin/util/BuildUtilTest.java b/src/test/java/au/com/centrumsystems/hudson/plugin/util/BuildUtilTest.java index 6869bb5e..ae17cace 100644 --- a/src/test/java/au/com/centrumsystems/hudson/plugin/util/BuildUtilTest.java +++ b/src/test/java/au/com/centrumsystems/hudson/plugin/util/BuildUtilTest.java @@ -53,7 +53,7 @@ public void setUp() throws Exception { @Test public void testGetDownstreamBuildWithLimit() throws Exception { int max_upstream_depth = 3; - int total_proj2_builds = 5; + int total_proj2_builds = 10; System.setProperty(BuildUtil.class.getCanonicalName() + ".MAX_DOWNSTREAM_DEPTH", String.valueOf(max_upstream_depth)); final FreeStyleProject proj1 = createFreeStyleProject(); @@ -75,10 +75,10 @@ public void testGetDownstreamBuildWithLimit() throws Exception { assertEquals("Proj2 does not have the correct number of builds.", total_proj2_builds + 1, proj2.getNextBuildNumber()); RunLoadCounter.prepare(proj2); - assertFalse(RunLoadCounter.assertMaxLoads(proj2, max_upstream_depth - 1, new Callable() { + assertNull(RunLoadCounter.assertMaxLoads(proj2, max_upstream_depth + 2, new Callable>() { @Override - public Boolean call() throws Exception { - return BuildUtil.getDownstreamBuild(proj2, freeStyleBuild) != null; + public AbstractBuild call() throws Exception { + return BuildUtil.getDownstreamBuild(proj2, freeStyleBuild); } })); }