public KsqlTarget target(final URI server) {
    return target(server, Collections.emptyMap());
  }
@Test
  public void shouldHandleErrorMessageOnPostRequests() {
    // Given:
    KsqlErrorMessage ksqlErrorMessage = new KsqlErrorMessage(40000, "ouch");
    server.setResponseObject(ksqlErrorMessage);
    server.setErrorCode(400);

    // When:
    KsqlTarget target = ksqlClient.target(serverUri);
    RestResponse<KsqlEntityList> response = target.postKsqlRequest("sql", Collections.emptyMap(), Optional.of(123L));

    // Then:
    assertThat(response.getStatusCode(), is(400));
    assertThat(response.getErrorMessage().getErrorCode(), is(40000));
    assertThat(response.getErrorMessage().getMessage(), is("ouch"));
  }