@Test
public void getStateThatDoesNotExistTest() {

    // Setup:
    when(stateManager.getState(any(Resource.class))).thenThrow(new IllegalArgumentException());
    Response response = target().path("states/" + encode(stateId.stringValue())).request().get();
    assertEquals(response.getStatus(), 404);
}