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


##########
extensions-contrib/opentelemetry-extensions/src/test/java/org/apache/druid/data/input/opentelemetry/protobuf/OpenTelemetryMetricsProtobufReaderTest.java:
##########
@@ -0,0 +1,442 @@
+/*
+ * 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.data.input.opentelemetry.protobuf;
+
+import com.google.common.collect.ImmutableList;
+import io.opentelemetry.proto.common.v1.AnyValue;
+import io.opentelemetry.proto.common.v1.KeyValue;
+import io.opentelemetry.proto.common.v1.KeyValueList;
+import io.opentelemetry.proto.metrics.v1.DataPointFlags;
+import io.opentelemetry.proto.metrics.v1.Metric;
+import io.opentelemetry.proto.metrics.v1.MetricsData;
+import org.apache.druid.data.input.InputRow;
+import org.apache.druid.data.input.impl.ByteEntity;
+import org.apache.druid.data.input.impl.DimensionsSpec;
+import org.apache.druid.data.input.impl.StringDimensionSchema;
+import org.apache.druid.indexing.seekablestream.SettableByteEntity;
+import org.apache.druid.java.util.common.parsers.CloseableIterator;
+import org.apache.druid.java.util.common.parsers.ParseException;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import java.io.IOException;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.concurrent.TimeUnit;
+
+public class OpenTelemetryMetricsProtobufReaderTest
+{
+  private static final long TIMESTAMP = 
TimeUnit.MILLISECONDS.toNanos(Instant.parse("2019-07-12T09:30:01.123Z").toEpochMilli());
+  public static final String RESOURCE_ATTRIBUTE_COUNTRY = "country";
+  public static final String RESOURCE_ATTRIBUTE_VALUE_USA = "usa";
+
+  public static final String RESOURCE_ATTRIBUTE_ENV = "env";
+  public static final String RESOURCE_ATTRIBUTE_VALUE_DEVEL = "devel";
+
+  public static final String INSTRUMENTATION_SCOPE_NAME = "mock-instr-lib";
+  public static final String INSTRUMENTATION_SCOPE_VERSION = "1.0";
+
+  public static final String METRIC_ATTRIBUTE_COLOR = "color";
+  public static final String METRIC_ATTRIBUTE_VALUE_RED = "red";
+
+  public static final String METRIC_ATTRIBUTE_FOO_KEY = "foo_key";
+  public static final String METRIC_ATTRIBUTE_FOO_VAL = "foo_value";
+
+  private final MetricsData.Builder metricsDataBuilder = 
MetricsData.newBuilder();
+
+  private final Metric.Builder metricBuilder = 
metricsDataBuilder.addResourceMetricsBuilder()
+      .addScopeMetricsBuilder()
+      .addMetricsBuilder();
+
+  private final DimensionsSpec dimensionsSpec = new 
DimensionsSpec(ImmutableList.of(
+      new StringDimensionSchema("descriptor." + METRIC_ATTRIBUTE_COLOR),
+      new StringDimensionSchema("descriptor." + METRIC_ATTRIBUTE_FOO_KEY),
+      new StringDimensionSchema("custom." + RESOURCE_ATTRIBUTE_ENV),
+      new StringDimensionSchema("custom." + RESOURCE_ATTRIBUTE_COUNTRY)
+  ));
+
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();

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



-- 
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