Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -62,6 +64,19 @@ public static void init() {
LOG.info("Test: aggregate metrics are updated correctly");
}

@BeforeEach
public void setup() {
//reset metrics before each test
RouterMetrics.destroy();
metrics = RouterMetrics.getMetrics();
}

@AfterEach
public void tearDown() {
RouterMetrics.destroy();
metrics = RouterMetrics.getMetrics();
}

/**
Comment on lines +67 to 80
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't just doing in BeforeEach enough?

* This test validates the correctness of the metric: Created Apps
* successfully.
Expand Down Expand Up @@ -2379,4 +2394,4 @@ public void testDeleteFederationPoliciesByQueuesRetrieved() {
metrics.getLatencySucceededDeleteFederationPoliciesByQueuesRetrieved(),
ASSERT_DOUBLE_DELTA);
}
}
}