  @Test
  public void invalidClient() throws Exception {

    SQSEvent event = new SQSEvent();
    SQSEvent.SQSMessage record = new SQSEvent.SQSMessage();
    record.setBody(createTableJson());
    event.setRecords(Lists.newArrayList(record));
    when(thriftHiveClientFactory.newInstance("thrift://uri:9083", "20000"))
        .thenThrow(new HiveClientException("init error"));
    Response response = privilegesGrantorLambda.handleRequest(event, context);
    verifyZeroInteractions(privilegesGrantor);
    assertThat(response.getStatusCode(), is(HttpStatus.SC_INTERNAL_SERVER_ERROR));
  }