github-advanced-security[bot] commented on code in PR #18460:
URL: https://github.com/apache/druid/pull/18460#discussion_r2315157517


##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaSamplerSpecTest.java:
##########
@@ -357,59 +256,24 @@
     );
     InputRowParser parser = new StringInputRowParser(new 
JSONParseSpec(timestampSpec, dimensionsSpec, JSONPathSpec.DEFAULT, null, null), 
"UTF8");
 
-    DataSchema dataSchema = DataSchema.builder()
-                                      .withDataSource("test_ds")
-                                      .withParserMap(
-                                          
objectMapper.readValue(objectMapper.writeValueAsBytes(parser), Map.class)
-                                      )
-                                      .withAggregators(
-                                          new 
DoubleSumAggregatorFactory("met1sum", "met1"),
-                                          new CountAggregatorFactory("rows")
-                                      )
-                                      .withGranularity(new 
UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null))
-                                      .withObjectMapper(objectMapper)
-                                      .build();
-
-    KafkaSupervisorSpec supervisorSpec = new KafkaSupervisorSpec(
-        null,
-        null,
-        dataSchema,
-        null,
-        new KafkaSupervisorIOConfig(
-            TOPIC,
-            null,
-            null,
-            null,
-            null,
-            null,
-            kafkaServer.consumerProperties(),
-            null,
-            null,
-            null,
-            null,
-            null,
-            true,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            false
-        ),
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null
-    );
+    Consumer<DataSchema.Builder> dataSchema =
+        builder -> builder.withDataSource("test_ds")
+                          .withParserMap(objectMapper.convertValue(parser, 
Map.class))
+                          .withAggregators(
+                              new DoubleSumAggregatorFactory("met1sum", 
"met1"),
+                              new CountAggregatorFactory("rows")
+                          )
+                          .withGranularity(new 
UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null))
+                          .withObjectMapper(objectMapper);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [Builder.withObjectMapper](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10264)



##########
extensions-core/kafka-indexing-service/src/test/java/org/apache/druid/indexing/kafka/KafkaSamplerSpecTest.java:
##########
@@ -357,59 +256,24 @@
     );
     InputRowParser parser = new StringInputRowParser(new 
JSONParseSpec(timestampSpec, dimensionsSpec, JSONPathSpec.DEFAULT, null, null), 
"UTF8");
 
-    DataSchema dataSchema = DataSchema.builder()
-                                      .withDataSource("test_ds")
-                                      .withParserMap(
-                                          
objectMapper.readValue(objectMapper.writeValueAsBytes(parser), Map.class)
-                                      )
-                                      .withAggregators(
-                                          new 
DoubleSumAggregatorFactory("met1sum", "met1"),
-                                          new CountAggregatorFactory("rows")
-                                      )
-                                      .withGranularity(new 
UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null))
-                                      .withObjectMapper(objectMapper)
-                                      .build();
-
-    KafkaSupervisorSpec supervisorSpec = new KafkaSupervisorSpec(
-        null,
-        null,
-        dataSchema,
-        null,
-        new KafkaSupervisorIOConfig(
-            TOPIC,
-            null,
-            null,
-            null,
-            null,
-            null,
-            kafkaServer.consumerProperties(),
-            null,
-            null,
-            null,
-            null,
-            null,
-            true,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            null,
-            false
-        ),
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null,
-        null
-    );
+    Consumer<DataSchema.Builder> dataSchema =
+        builder -> builder.withDataSource("test_ds")
+                          .withParserMap(objectMapper.convertValue(parser, 
Map.class))

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [Builder.withParserMap](1) should be avoided because it has been 
deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10265)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to