use of io.confluent.ksql.util.KsqlSchemaRegistryNotConfiguredException in project ksql by confluentinc.
the class SchemaRegisterInjectorTest method shouldNotRegisterSchemaForSchemaRegistryDisabledFormatCreateAsSelect.
@Test
public void shouldNotRegisterSchemaForSchemaRegistryDisabledFormatCreateAsSelect() {
// Given:
config = new KsqlConfig(ImmutableMap.of());
givenStatement("CREATE STREAM sink WITH(value_format='DELIMITED') AS SELECT * FROM SOURCE;");
// When:
final KsqlSchemaRegistryNotConfiguredException e = assertThrows(KsqlSchemaRegistryNotConfiguredException.class, () -> injector.inject(statement));
// Then:
assertThat(e.getMessage(), containsString("Cannot create topic 'SINK' with format AVRO without configuring"));
}
use of io.confluent.ksql.util.KsqlSchemaRegistryNotConfiguredException in project ksql by confluentinc.
the class ErrorsTest method shouldReturnSchemaRegistryNotConfiguredResponseIfRootCauseKsqlSchemaRegistryConfigException.
@Test
public void shouldReturnSchemaRegistryNotConfiguredResponseIfRootCauseKsqlSchemaRegistryConfigException() {
final EndpointResponse response = errorHandler.generateResponse(new KsqlException(new KsqlSchemaRegistryNotConfiguredException("error")), Errors.badRequest("bad"));
assertThat(response.getStatus(), is(428));
assertThat(response.getEntity(), is(instanceOf(KsqlErrorMessage.class)));
assertThat(((KsqlErrorMessage) response.getEntity()).getMessage(), is(SOME_SR_ERROR));
}
use of io.confluent.ksql.util.KsqlSchemaRegistryNotConfiguredException in project ksql by confluentinc.
the class SchemaRegisterInjectorTest method shouldNotRegisterSchemaIfSchemaRegistryIsDisabled.
@Test
public void shouldNotRegisterSchemaIfSchemaRegistryIsDisabled() {
// Given:
config = new KsqlConfig(ImmutableMap.of());
givenStatement("CREATE STREAM sink (f1 VARCHAR) WITH(kafka_topic='expectedName', key_format='AVRO', value_format='AVRO', partitions=1);");
// When:
final KsqlSchemaRegistryNotConfiguredException e = assertThrows(KsqlSchemaRegistryNotConfiguredException.class, () -> injector.inject(statement));
// Then:
assertThat(e.getMessage(), containsString("Cannot create topic 'expectedName' with format AVRO without configuring"));
}
Aggregations