Skip to content

Instantly share code, notes, and snippets.

@minisu
Last active August 29, 2015 13:58
Show Gist options
  • Save minisu/9972220 to your computer and use it in GitHub Desktop.
Save minisu/9972220 to your computer and use it in GitHub Desktop.
@Test
public void accessingNonExistentTest_should_fail()
{
asList( "", "/assets", "/live-tabular-stats" )
.forEach( this::assertPathYields404 );
}
private void assertPathYields404( String path )
{
ClientResponse response = R.client().resource( ENDPOINT + "/"+ nonExistentId + path )
.get( ClientResponse.class );
assertThat( response.getStatus(), is( NOT_FOUND_404 ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment