github-advanced-security[bot] commented on code in PR #19046: URL: https://github.com/apache/druid/pull/19046#discussion_r2841140093
########## embedded-tests/src/test/java/org/apache/druid/testing/embedded/kinesis/KinesisDataFormatsTest.java: ########## @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.testing.embedded.kinesis; + +import org.apache.druid.data.input.InputFormat; +import org.apache.druid.data.input.impl.DimensionsSpec; +import org.apache.druid.data.input.impl.TimestampSpec; +import org.apache.druid.indexer.granularity.UniformGranularitySpec; +import org.apache.druid.indexing.kinesis.KinesisRegion; +import org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorIOConfig; +import org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorSpec; +import org.apache.druid.indexing.overlord.supervisor.SupervisorSpec; +import org.apache.druid.java.util.common.granularity.Granularities; +import org.apache.druid.segment.indexing.DataSchema; +import org.apache.druid.testing.embedded.StreamIngestResource; +import org.apache.druid.testing.embedded.indexing.StreamIndexDataFormatsTestBase; +import org.joda.time.Period; + +import java.util.Map; + +/** + * Verifies Kinesis ingestion using various input data formats. + */ +public class KinesisDataFormatsTest extends StreamIndexDataFormatsTestBase +{ + private final KinesisResource kinesis = new KinesisResource(); + + @Override + protected StreamIngestResource<?> createStreamResource() + { + return kinesis; + } + + @Override + protected SupervisorSpec createSupervisor(String dataSource, String topic, InputFormat inputFormat) + { + return createKinesisSupervisorSpec(dataSource, topic, inputFormat); + } + + @Override + protected SupervisorSpec createSupervisorWithParser(String dataSource, String topic, Map<String, Object> parserMap) + { + final KinesisSupervisorSpec baseSpec = createKinesisSupervisorSpec(dataSource, topic, null); + return new KinesisSupervisorSpec( + dataSource, + null, + DataSchema.builder(baseSpec.getSpec().getDataSchema()) + .withParserMap(parserMap) 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/10825) ########## embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/KafkaIndexDataFormatsTest.java: ########## @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.testing.embedded.indexing; + +import org.apache.druid.data.input.InputFormat; +import org.apache.druid.data.input.impl.TimestampSpec; +import org.apache.druid.indexing.kafka.simulate.KafkaResource; +import org.apache.druid.indexing.overlord.supervisor.SupervisorSpec; +import org.apache.druid.testing.embedded.StreamIngestResource; +import org.joda.time.Period; + +import java.util.Map; + +public class KafkaIndexDataFormatsTest extends StreamIndexDataFormatsTestBase +{ + private final KafkaResource kafka = new KafkaResource(); + + @Override + protected StreamIngestResource<?> createStreamResource() + { + return kafka; + } + + @Override + public SupervisorSpec createSupervisorWithParser(String dataSource, String topic, Map<String, Object> parserMap) + { + return MoreResources.Supervisor.KAFKA_JSON + .get() + .withDataSchema( + schema -> schema + .withTimestamp(new TimestampSpec("timestamp", null, null)) + .withParserMap(parserMap) 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/10824) -- 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]
