dplavcic commented on code in PR #12449:
URL: https://github.com/apache/kafka/pull/12449#discussion_r935983777


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImplTest.java:
##########
@@ -736,42 +705,34 @@ public void shouldProvideCorrectStrings() {
         assertThat(ROLLUP_VALUE, is("all"));
     }
 
-    private void setupRemoveSensorsTest(final Metrics metrics,
-                                        final String level) {
-        final String fullSensorNamePrefix = INTERNAL_PREFIX + 
SENSOR_PREFIX_DELIMITER + level + SENSOR_NAME_DELIMITER;
-        resetToDefault(metrics);
-        metrics.removeSensor(fullSensorNamePrefix + SENSOR_NAME_1);
-        metrics.removeSensor(fullSensorNamePrefix + SENSOR_NAME_2);

Review Comment:
   `setupRemoveSensorsTest` was called only inside the 
`shouldRemoveThreadLevelSensors`. 
   
   Since these two lines are used only to verify things, they were moved to the 
`shouldRemoveThreadLevelSensors` where verification should indeed happen:
   ```java
           metrics.removeSensor(fullSensorNamePrefix + SENSOR_NAME_1);
           metrics.removeSensor(fullSensorNamePrefix + SENSOR_NAME_2);
   ```
   
   
   



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to