phet commented on code in PR #3933:
URL: https://github.com/apache/gobblin/pull/3933#discussion_r1578581833


##########
gobblin-metrics-libs/gobblin-metrics/src/test/java/org/apache/gobblin/metrics/OpenTelemetryMetricsTest.java:
##########
@@ -38,21 +38,25 @@ void testInitializeOpenTelemetryFailsWithoutEndpoint() {
   }
 
   @Test
-  void testInitializeOpenTelemetrySucceedsWithEndpoint() {
+  public void testInitializeOpenTelemetrySucceedsWithEndpoint() {
     State opentelemetryState = new State();
     
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENABLED,
 "true");
     
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENDPOINT,
 "http://localhost:4317";);
-    OpenTelemetryMetrics metricsProvider = 
OpenTelemetryMetrics.getInstance(opentelemetryState);
-    System.out.println(metricsProvider.metricExporter.toString());
+    // Should not throw an exception
+    OpenTelemetryMetrics.getInstance(opentelemetryState);

Review Comment:
   since every test should have an assertion, just do an "assert true"



##########
gobblin-metrics-libs/gobblin-metrics/src/test/java/org/apache/gobblin/metrics/OpenTelemetryMetricsTest.java:
##########
@@ -38,21 +38,25 @@ void testInitializeOpenTelemetryFailsWithoutEndpoint() {
   }
 
   @Test
-  void testInitializeOpenTelemetrySucceedsWithEndpoint() {
+  public void testInitializeOpenTelemetrySucceedsWithEndpoint() {
     State opentelemetryState = new State();
     
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENABLED,
 "true");
     
opentelemetryState.setProp(ConfigurationKeys.METRICS_REPORTING_OPENTELEMETRY_ENDPOINT,
 "http://localhost:4317";);
-    OpenTelemetryMetrics metricsProvider = 
OpenTelemetryMetrics.getInstance(opentelemetryState);
-    System.out.println(metricsProvider.metricExporter.toString());
+    // Should not throw an exception
+    OpenTelemetryMetrics.getInstance(opentelemetryState);
   }
 
   @Test
-  void testHeadersParseCorrectly() {
+  public void testHeadersParseCorrectly() {
     Map<String, String> headers = OpenTelemetryMetrics.parseHttpHeaders(
         
"{\"Content-Type\":\"application/x-protobuf\",\"headerTag\":\"tag1:value1,tag2:value2\"}");
     Assert.assertEquals(headers.size(), 2);
     Assert.assertEquals(headers.get("Content-Type"), "application/x-protobuf");
     Assert.assertEquals(headers.get("headerTag"), "tag1:value1,tag2:value2");
   }
-
+  @Test

Review Comment:
   newline above



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

Reply via email to