@Test
public void testAuthValidatorForPut() throws Exception {

  RequestContext requestContext = mock(RequestContext.class);
  Request request = Request.forUri("/", "PUT")
      .withPayload(ByteString.encodeUtf8("hello"));
  when(requestContext.request()).thenReturn(request);
  Response<Object> response = awaitResponse(Middlewares.authenticator(authenticator)
                                                .apply(mockInnerHandler(requestContext))
                                                .invoke(requestContext));
  assertThat(response, hasStatus(withCode(Status.UNAUTHORIZED)));
}