Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yupeng Fu <[email protected]>
  • Loading branch information
yupeng9 committed Jan 22, 2025
1 parent 8e7af9c commit 4e0a4fa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testKafkaIngestion() {
.put("ingestion_source.type", "kafka")
.put("ingestion_source.pointer.init.reset", "earliest")
.put("ingestion_source.param.topic", "test")
.put("ingestion_source.param.bootstrapServers", kafka.getBootstrapServers())
.put("ingestion_source.param.bootstrap_servers", kafka.getBootstrapServers())
.build(),
"{\"properties\":{\"name\":{\"type\": \"text\"},\"age\":{\"type\": \"integer\"}}}}"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class KafkaSourceConfig {
public KafkaSourceConfig(Map<String, Object> params) {
// TODO: better parsing and validation
this.topic = (String) Objects.requireNonNull(params.get("topic"));
this.bootstrapServers = (String) Objects.requireNonNull(params.get("bootstrapServers"));
this.bootstrapServers = (String) Objects.requireNonNull(params.get("bootstrap_servers"));
assert this.bootstrapServers != null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void testInitialize() {
KafkaConsumerFactory factory = new KafkaConsumerFactory();
Map<String, Object> params = new HashMap<>();
params.put("topic", "test-topic");
params.put("bootstrapServers", "localhost:9092");
params.put("bootstrap_servers", "localhost:9092");

factory.initialize(params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void setUp() throws Exception {
super.setUp();
Map<String, Object> params = new HashMap<>();
params.put("topic", "test-topic");
params.put("bootstrapServers", "localhost:9092");
params.put("bootstrap_servers", "localhost:9092");

config = new KafkaSourceConfig(params);
mockConsumer = mock(KafkaConsumer.class);
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testLatestPointer() {
public void testTopicDoesNotExist() {
Map<String, Object> params = new HashMap<>();
params.put("topic", "non-existent-topic");
params.put("bootstrapServers", "localhost:9092");
params.put("bootstrap_servers", "localhost:9092");
var kafkaSourceConfig = new KafkaSourceConfig(params);
when(mockConsumer.partitionsFor(eq("non-existent-topic"), any(Duration.class))).thenReturn(null);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class KafkaSourceConfigTests extends OpenSearchTestCase {
public void testConstructorAndGetters() {
Map<String, Object> params = new HashMap<>();
params.put("topic", "topic");
params.put("bootstrapServers", "bootstrap");
params.put("bootstrap_servers", "bootstrap");

KafkaSourceConfig config = new KafkaSourceConfig(params);

Expand Down

0 comments on commit 4e0a4fa

Please sign in to comment.