Skip to content

Commit

Permalink
Merge branch 'main' into wildcard-support
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosentino11 authored Feb 5, 2024
2 parents 283fc94 + ce7453b commit af4ddfe
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ void GIVEN_kernelRunningWithMetricsConfig_WHEN_verifyClientDeviceIdentity_THEN_s
Metric expectedMetric = buildMetric(METRIC_VERIFY_CLIENT_DEVICE_IDENTITY_SUCCESS);
startNucleusWithConfig("metricsConfig.yaml");

//Reset the metric spy and capture the emitted metrics when the emitter runs
Mockito.reset(metricSpy);
ResultCaptor<List<Metric>> resultMetrics = new ResultCaptor<>();
doAnswer(resultMetrics).when(metricSpy).collectMetrics();

//Verify client device identity
try (EventStreamRPCConnection connection = IPCTestUtils.getEventStreamRpcConnection(kernel,
"BrokerSubscribingToCertUpdates")) {
Expand All @@ -295,11 +300,6 @@ void GIVEN_kernelRunningWithMetricsConfig_WHEN_verifyClientDeviceIdentity_THEN_s
ipcClient.verifyClientDeviceIdentity(request, Optional.empty()).getResponse();
}

//Reset the metric spy and capture the emitted metrics when the emitter runs
Mockito.reset(metricSpy);
ResultCaptor<List<Metric>> resultMetrics = new ResultCaptor<>();
doAnswer(resultMetrics).when(metricSpy).collectMetrics();

//Wait for the emitter to run
Mockito.verify(metricSpy, Mockito.timeout(2000L).atLeastOnce()).emitMetrics();

Expand Down

0 comments on commit af4ddfe

Please sign in to comment.