    @Test
    public void testGetIdAsStringInvalidClock() throws Exception {

        when(worker.getId(AGENT)).thenThrow(new InvalidSystemClock());

        try {
            resources.client().target("/").request(MediaType.TEXT_PLAIN)
            .header(HttpHeaders.USER_AGENT, AGENT)
            .get(ClientResponse.class);
            failBecauseExceptionWasNotThrown(InternalServerErrorException.class);
        } catch (final InternalServerErrorException e) {
            assertThat(e.getResponse().getStatus()).isEqualTo(500);
        }

        verify(worker).getId(AGENT);
    }