use of io.confluent.ksql.rest.entity.PropertiesList.Property in project ksql by confluentinc.
the class KsqlResourceTest method shouldListPropertiesWithOverrides.
@Test
public void shouldListPropertiesWithOverrides() {
// Given:
final Map<String, Object> overrides = Collections.singletonMap("auto.offset.reset", "latest");
// When:
final PropertiesList props = makeSingleRequest(new KsqlRequest("list properties;", overrides, emptyMap(), null), PropertiesList.class);
// Then:
assertThat(props.getProperties(), hasItem(new Property("ksql.streams.auto.offset.reset", "KSQL", "latest")));
assertThat(props.getOverwrittenProperties(), hasItem("ksql.streams.auto.offset.reset"));
}
use of io.confluent.ksql.rest.entity.PropertiesList.Property in project ksql by confluentinc.
the class PropertiesListTableBuilderTest method shouldHandlePropertiesWithNullValue.
@Test
public void shouldHandlePropertiesWithNullValue() {
// Given:
final PropertiesList propList = new PropertiesList("list properties;", Collections.singletonList(new Property(SOME_KEY, "KSQL", null)), Collections.emptyList(), ImmutableList.of(SOME_KEY));
// When:
final Table table = builder.buildTable(propList);
// Then:
assertThat(getRows(table), contains(row(SOME_KEY, "KSQL", "", "NULL")));
}
use of io.confluent.ksql.rest.entity.PropertiesList.Property in project ksql by confluentinc.
the class ListPropertiesExecutorTest method shouldListUnresolvedStreamsTopicProperties.
@Test
public void shouldListUnresolvedStreamsTopicProperties() {
// When:
final PropertiesList properties = (PropertiesList) CUSTOM_EXECUTORS.listProperties().execute((ConfiguredStatement<ListProperties>) engine.configure("LIST PROPERTIES;").withConfig(new KsqlConfig(ImmutableMap.of("ksql.streams.topic.min.insync.replicas", "2"))), mock(SessionProperties.class), engine.getEngine(), engine.getServiceContext()).getEntity().orElseThrow(IllegalStateException::new);
// Then:
assertThat(properties.getProperties(), hasItem(new Property("ksql.streams.topic.min.insync.replicas", "KSQL", "2")));
}
use of io.confluent.ksql.rest.entity.PropertiesList.Property in project ksql by confluentinc.
the class KsqlResourceTest method shouldNotIncludeSslPropertiesInListPropertiesOutput.
@Test
public void shouldNotIncludeSslPropertiesInListPropertiesOutput() {
// When:
final PropertiesList props = makeSingleRequest("list properties;", PropertiesList.class);
// Then:
assertThat(props.getProperties().stream().map(Property::getName).collect(Collectors.toList()), not(hasItems(KsqlConfig.SSL_CONFIG_NAMES.toArray(new String[0]))));
}
use of io.confluent.ksql.rest.entity.PropertiesList.Property in project ksql by confluentinc.
the class ListPropertiesExecutorTest method shouldNotListUnrecognizedConnectProps.
@Test
public void shouldNotListUnrecognizedConnectProps() throws Exception {
// Given:
givenConnectWorkerProperties("group.id=list_properties_unit_test\n" + "key.converter=io.confluent.connect.avro.AvroConverter\n" + "value.converter=io.confluent.connect.avro.AvroConverter\n" + "offset.storage.topic=topic1\n" + "config.storage.topic=topic2\n" + "status.storage.topic=topic3\n" + "other.config=<potentially sensitive data that should not be shown>\n" + "sasl.jaas.config=<potentially sensitive data that should not be shown even though it's a recognized config>\n");
// When:
final PropertiesList properties = (PropertiesList) CUSTOM_EXECUTORS.listProperties().execute((ConfiguredStatement<ListProperties>) engine.configure("LIST PROPERTIES;").withConfig(new KsqlConfig(ImmutableMap.of("ksql.connect.worker.config", connectPropsFile))), mock(SessionProperties.class), engine.getEngine(), engine.getServiceContext()).getEntity().orElseThrow(IllegalStateException::new);
// Then:
assertThat(properties.getProperties(), hasItem(new Property("ksql.connect.worker.config", "KSQL", connectPropsFile)));
assertThat(properties.getProperties(), hasItem(new Property("value.converter", "EMBEDDED CONNECT WORKER", "io.confluent.connect.avro.AvroConverter")));
assertThat(toMap(properties), not(hasKey("other.config")));
assertThat(toMap(properties), not(hasKey("sasl.jaas.config")));
}
Aggregations