Skip to content

Commit

Permalink
Update MockOciMetricsBean.registerOciMetrics() to look exactly like t…
Browse files Browse the repository at this point in the history
…he one in OciMetricsBean.
  • Loading branch information
klustria committed Mar 12, 2024
1 parent 1dd578b commit 0149132
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ interface MetricDataDetailsOCIParams {

static class MockOciMetricsBean extends OciMetricsBean {
@Override
void registerOciMetrics(@Observes @Priority(LIBRARY_BEFORE + 10) @Initialized(ApplicationScoped.class) Object ignore,
Config config, Monitoring monitoringClient) {
void registerOciMetrics(@Observes @Priority(LIBRARY_BEFORE + 20) @Initialized(ApplicationScoped.class) Object ignore,
Config rootConfig, Monitoring monitoringClient) {
Monitoring mockedMonitoringClient = mock(Monitoring.class);
when(mockedMonitoringClient.getEndpoint()).thenReturn("http://www.DummyEndpoint.com");
doAnswer(invocationOnMock -> {
Expand All @@ -174,7 +174,7 @@ void registerOciMetrics(@Observes @Priority(LIBRARY_BEFORE + 10) @Initialized(Ap
.__httpStatusCode__(200)
.build();
}).when(mockedMonitoringClient).postMetricData(any());
super.registerOciMetrics(ignore, config, mockedMonitoringClient);
super.registerOciMetrics(ignore, rootConfig, mockedMonitoringClient);
}

// Override so we can test if this is invoked when enabled or skipped when disabled
Expand Down

0 comments on commit 0149132

Please sign in to comment.