use of io.confluent.ksql.rest.client.RestResponse in project ksql by confluentinc.
the class RemoteCliSpecificCommandTest method shouldPrintErrorOnErrorResponseFromRestClient.
@Test
public void shouldPrintErrorOnErrorResponseFromRestClient() {
final Cli.RemoteServerSpecificCommand command = new Cli.RemoteServerSpecificCommand(new KsqlRestClient("xxxx", Collections.emptyMap()) {
@Override
public RestResponse<ServerInfo> getServerInfo() {
return RestResponse.erroneous(new ErrorMessage("it is broken", Collections.emptyList()));
}
}, new PrintWriter(out));
command.execute("http://localhost:8088");
assertThat(out.toString(), containsString("it is broken"));
}
Aggregations