Skip to content

Commit

Permalink
Added test for poller
Browse files Browse the repository at this point in the history
  • Loading branch information
drrb committed Apr 26, 2014
1 parent b22c3f3 commit 9ae701f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/io/github/drrb/goforgepoller/ForgePollerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,14 @@ public void shouldReturnNullIfLatestVersionIsntGreaterThanLastKnownVersion() thr

assertThat(result, is(nullValue()));
}

@Test
public void shouldReturnNullIfLatestVersionNotFound() throws Exception {
PackageRevision lastKnownRevision = new PackageRevision("1.0.0", null, null);
when(forge.getLatestVersion(moduleSpec)).thenThrow(new Forge.ModuleNotFound("Failed to list versions of module 'puppetlabs/apache' (500)"));

PackageRevision result = poller.latestModificationSince(packageConfig, repoConfig, lastKnownRevision);

assertThat(result, is(nullValue()));
}
}

0 comments on commit 9ae701f

Please sign in to comment.