use of io.confluent.ksql.rest.entity.DropConnectorEntity in project ksql by confluentinc.
the class ClientTest method shouldDropConnector.
@Test
public void shouldDropConnector() throws Exception {
// Given
final DropConnectorEntity entity = new DropConnectorEntity("drop connector;", "name");
testEndpoints.setKsqlEndpointResponse(Collections.singletonList(entity));
// When:
javaClient.dropConnector("name").get();
// Then:
assertThat(testEndpoints.getLastSql(), is("drop connector name;"));
}
use of io.confluent.ksql.rest.entity.DropConnectorEntity in project ksql by confluentinc.
the class ClientTest method shouldSendSessionVariablesWithDropConnector.
@Test
public void shouldSendSessionVariablesWithDropConnector() throws Exception {
// Given:
javaClient.define("a", "a");
final DropConnectorEntity entity = new DropConnectorEntity("drop connector;", "name");
testEndpoints.setKsqlEndpointResponse(Collections.singletonList(entity));
// When:
javaClient.dropConnector("name").get();
// Then:
assertThat(testEndpoints.getLastSessionVariables(), is(new JsonObject().put("a", "a")));
}
use of io.confluent.ksql.rest.entity.DropConnectorEntity in project ksql by confluentinc.
the class ClientTest method shouldFailToDropConnectorViaExecuteStatement.
@Test
public void shouldFailToDropConnectorViaExecuteStatement() {
// Given
final DropConnectorEntity entity = new DropConnectorEntity("drop connector;", "name");
testEndpoints.setKsqlEndpointResponse(Collections.singletonList(entity));
// When
final Exception e = assertThrows(// thrown from .get() when the future completes exceptionally
ExecutionException.class, () -> javaClient.executeStatement("drop connector;").get());
// Then
assertThat(e.getCause(), instanceOf(KsqlClientException.class));
assertThat(e.getCause().getMessage(), containsString(EXECUTE_STATEMENT_REQUEST_ACCEPTED_DOC));
assertThat(e.getCause().getMessage(), containsString(EXECUTE_STATEMENT_USAGE_DOC));
assertThat(e.getCause().getMessage(), containsString("Use the dropConnector() method instead"));
}
use of io.confluent.ksql.rest.entity.DropConnectorEntity in project ksql by confluentinc.
the class ConsoleTest method shouldPrintDropConnector.
@Test
public void shouldPrintDropConnector() {
// Given:
final KsqlEntity entity = new DropConnectorEntity("statementText", "connectorName");
// When:
console.printKsqlEntityList(ImmutableList.of(entity));
// Then:
final String output = terminal.getOutputString();
Approvals.verify(output, approvalOptions);
}
Aggregations