@Test
public void testInvalidToken() {

  when(authenticator.authenticate(any())).thenThrow(IllegalArgumentException.class);
  final Request request = Request.forUri("/", "PUT")
      .withHeader(HttpHeaders.AUTHORIZATION, "Bearer broken")
      .withPayload(ByteString.encodeUtf8("hello"));
  try {
    sut.authenticate(request);
    fail();
  } catch (ResponseException e) {
    assertThat(e.getResponse().status(), is(
        Status.BAD_REQUEST.withReasonPhrase("Failed to parse Authorization token")));
  }
}