Skip to content

Commit

Permalink
Fix naming bug, update tests and expected test results
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenvandisseldorp committed Jun 27, 2024
1 parent 6912d44 commit 9df72fd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public StructsParser<ToOperation> parser() {
(name, tags) -> {
// Try to find a corresponding topic definition
final var topic = resources().topic(name);
return topic != null ? new ToOperation(operationConfig(defaultLongName(), tags), topic, null) : null;
return topic != null ? new ToOperation(operationConfig(null, tags), topic, null) : null;
},
new ToOperationDefinitionParser());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public StructsParser<ToTopicNameExtractorOperation> parser() {
(name, tags) -> {
// Try to find a corresponding topic definition
final var tne = resources().function(name);
return tne != null ? new ToTopicNameExtractorOperation(operationConfig(defaultLongName(), tags), tne, null) : null;
return tne != null ? new ToTopicNameExtractorOperation(operationConfig(null, tags), tne, null) : null;
},
new ToOperationDefinitionParser());
}
Expand Down
17 changes: 9 additions & 8 deletions ksml/src/test/resources/pipelines/5-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ pipelines:
- name: before-peek
type: peek
forEach: print_message
toExtractor:
code: |
if key == 'sensor1':
return 'ksml_sensordata_sensor1'
elif key == 'sensor2':
return 'ksml_sensordata_sensor2'
else:
return 'ksml_sensordata_sensor0'
toTopicNameExtractor:
topicNameExtractor:
code: |
if key == 'sensor1':
return 'ksml_sensordata_sensor1'
elif key == 'sensor2':
return 'ksml_sensordata_sensor2'
else:
return 'ksml_sensordata_sensor0'
2 changes: 1 addition & 1 deletion ksml/src/test/resources/pipelines/test-routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pipelines:
- name: before_peek
type: peek
forEach: print_message
to:
toTopicNameExtractor:
topicNameExtractor:
code: |
if key == 'sensor1':
Expand Down
4 changes: 3 additions & 1 deletion ksml/src/test/resources/reference/5-reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ Topologies:
Source: ksml_sensordata_avro (topics: [ksml_sensordata_avro])
--> test_before-peek
Processor: test_before-peek (stores: [])
--> none
--> test_pipelines_main_toTopicNameExtractor
<-- ksml_sensordata_avro
Sink: test_pipelines_main_toTopicNameExtractor (extractor class: io.axual.ksml.user.UserTopicNameExtractor)
<-- test_before-peek

0 comments on commit 9df72fd

Please sign in to comment.