Skip to content

Instantly share code, notes, and snippets.

@rowanl
Created January 17, 2018 20:06
Show Gist options
  • Save rowanl/6b92ada64c6e0e9393515e609be0fc18 to your computer and use it in GitHub Desktop.
Save rowanl/6b92ada64c6e0e9393515e609be0fc18 to your computer and use it in GitHub Desktop.
playframework-kubernetes - Functional test with mocked time dependency
@Test
public void Given_IsBeforeEndDate_When_GetRequestIsMadeToIndexPage_Then_StatusIs200() {
// GIVEN
long beforeEndDate = 9L;
given(clock.instant()).willReturn(ofEpochMilli(beforeEndDate));
given(clock.getZone()).willReturn(ZoneId.of("+0"));
// WHEN
WSResponse result = newClient(providePort()).url("/").get().toCompletableFuture().join();
// THEN
assertThat(result.getStatus(), is(OK));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment