Skip to content

Commit

Permalink
fix: change configOverrides back to streamsProperties (#4675)
Browse files Browse the repository at this point in the history
* fix: change configOverrides back to streamsProperties

Revert the breaking api change

* fix: missed annotation
  • Loading branch information
rodesai authored Mar 1, 2020
1 parent 9079fc0 commit ce74cf8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public void shouldReturnErrorOnInvalidStreamProperty() throws Exception {
// Given:
final String jsonRequest = "{"
+ "\"ksql\":\"sql\","
+ "\"configOverrides\":{"
+ "\"streamsProperties\":{"
+ "\"unknown-property\":true"
+ "}}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void shouldSerialiseDeserialise() {

// Then:
assertThat(buff, is(notNullValue()));
String expectedJson = "{\"ksql\":\"some ksql\",\"configOverrides\":{\"auto.offset.reset\":\""
String expectedJson = "{\"ksql\":\"some ksql\",\"streamsProperties\":{\"auto.offset.reset\":\""
+ "latest\"},\"requestProperties\":{},\"commandSequenceNumber\":21345}";
assertThat(new JsonObject(buff), is(new JsonObject(expectedJson)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class KsqlRequest {
@JsonCreator
public KsqlRequest(
@JsonProperty("ksql") final String ksql,
@JsonProperty("configOverrides") final Map<String, ?> configOverrides,
@JsonProperty("streamsProperties") final Map<String, ?> configOverrides,
@JsonProperty("requestProperties") final Map<String, ?> requestProperties,
@JsonProperty("commandSequenceNumber") final Long commandSequenceNumber
) {
Expand All @@ -62,6 +62,7 @@ public String getKsql() {
return ksql;
}

@JsonProperty("streamsProperties")
public Map<String, Object> getConfigOverrides() {
return coerceTypes(configOverrides);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class KsqlRequestTest {
private static final ObjectMapper OBJECT_MAPPER = JsonMapper.INSTANCE.mapper;
private static final String A_JSON_REQUEST = "{"
+ "\"ksql\":\"sql\","
+ "\"configOverrides\":{"
+ "\"streamsProperties\":{"
+ "\"" + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG + "\":\"earliest\","
+ "\"" + StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG + "\":\""
+ TimestampExtractor.class.getCanonicalName() + "\""
Expand All @@ -56,7 +56,7 @@ public class KsqlRequestTest {
+ "}}";
private static final String A_JSON_REQUEST_WITH_COMMAND_NUMBER = "{"
+ "\"ksql\":\"sql\","
+ "\"configOverrides\":{"
+ "\"streamsProperties\":{"
+ "\"" + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG + "\":\"earliest\","
+ "\"" + StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG + "\":\""
+ TimestampExtractor.class.getCanonicalName() + "\""
Expand All @@ -67,7 +67,7 @@ public class KsqlRequestTest {
+ "\"commandSequenceNumber\":2}";
private static final String A_JSON_REQUEST_WITH_NULL_COMMAND_NUMBER = "{"
+ "\"ksql\":\"sql\","
+ "\"configOverrides\":{"
+ "\"streamsProperties\":{"
+ "\"" + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG + "\":\"earliest\","
+ "\"" + StreamsConfig.DEFAULT_TIMESTAMP_EXTRACTOR_CLASS_CONFIG + "\":\""
+ TimestampExtractor.class.getCanonicalName() + "\""
Expand Down Expand Up @@ -178,7 +178,7 @@ public void shouldHandleShortProperties() {
// Given:
final String jsonRequest = "{"
+ "\"ksql\":\"sql\","
+ "\"configOverrides\":{"
+ "\"streamsProperties\":{"
+ "\"" + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG + "\":\"earliest\""
+ "}}";

Expand Down

0 comments on commit ce74cf8

Please sign in to comment.