diff --git a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/ScanDataPublisherRouteBuilderTests.java b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/ScanDataPublisherRouteBuilderTests.java index 43cef4bd..b8e16309 100644 --- a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/ScanDataPublisherRouteBuilderTests.java +++ b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/ScanDataPublisherRouteBuilderTests.java @@ -71,7 +71,7 @@ public static RoutesBuilder createRouteBuilder() { SolacePublisher solacePublisher = mock(SolacePublisher.class); EventPortalProperties eventPortalProperties = mock(EventPortalProperties.class); MeterRegistry meterRegistry = mock(MeterRegistry.class); - when(meterRegistry.counter(any(), any(), any(), any(), any(), any(), any(), any(), any())) + when(meterRegistry.counter(any(), any(String[].class))) .thenReturn(new NoopCounter(new Meter.Id("noop", null, null, null, null))); ScanDataPublisher scanDataPublisher = new ScanDataPublisher(solacePublisher, meterRegistry); diff --git a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java index 20b73416..e7a810b1 100644 --- a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java +++ b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java @@ -18,7 +18,9 @@ import com.solace.maas.ep.event.management.agent.repository.scan.ScanTypeRepository; import com.solace.maas.ep.event.management.agent.service.logging.LoggingService; import com.solace.maas.ep.event.management.agent.util.IDGenerator; +import io.micrometer.core.instrument.Meter; import io.micrometer.core.instrument.MeterRegistry; +import io.micrometer.core.instrument.noop.NoopCounter; import lombok.SneakyThrows; import org.apache.camel.Processor; import org.apache.camel.Produce; @@ -96,7 +98,7 @@ public class ScanServiceTests { @Autowired private ScanServiceHelper scanServiceHelper; - @Autowired + @Mock private MeterRegistry meterRegistry; @Test @@ -147,9 +149,10 @@ public void testSingleScanWithRouteBundle() { .thenReturn(scanType); when(scanStatusRepository.save(scanStatus)) .thenReturn(scanStatus); - when(scanRecipientHierarchyRepository.save(any(ScanRecipientHierarchyEntity.class))) .thenReturn(mock(ScanRecipientHierarchyEntity.class)); + when(meterRegistry.counter(any(), any(String[].class))) + .thenReturn(new NoopCounter(new Meter.Id("noop", null, null, null, null))); scanService.singleScan(List.of(topicListing, consumerGroups, additionalConsumerGroupConfigBundle), "groupId", @@ -314,6 +317,8 @@ public void testParseRouteRecipients() { @Test @SneakyThrows public void testSendScanStatus() { + when(meterRegistry.counter(any(), any(String[].class))) + .thenReturn(new NoopCounter(new Meter.Id("noop", null, null, null, null))); ScanService service = new ScanService(mock(ScanRepository.class), mock(ScanRecipientHierarchyRepository.class), mock(ScanTypeRepository.class), mock(ScanStatusRepository.class), mock(ScanRouteService.class), mock(RouteService.class), diff --git a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/subscriber/MessageReceiverTests.java b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/subscriber/MessageReceiverTests.java index 65b2df2c..5000731e 100644 --- a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/subscriber/MessageReceiverTests.java +++ b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/subscriber/MessageReceiverTests.java @@ -94,7 +94,7 @@ public void scanReceiver() { when(inboundMessage.getProperty(MOPConstants.MOP_MSG_META_DECODER)).thenReturn( "com.solace.maas.ep.common.messages.ScanCommandMessage"); when(inboundMessage.getDestinationName()).thenReturn("anyTopic"); - when(meterRegistry.counter(any(), any(), any(), any(), any(), any(), any())).thenReturn(new NoopCounter( + when(meterRegistry.counter(any(), any(String[].class))).thenReturn(new NoopCounter( new Meter.Id("mockMeterId", null, null, null, null))); ScanCommandMessageHandler scanCommandMessageHandler = new ScanCommandMessageHandler( @@ -123,7 +123,7 @@ public void testBadClass() { @Test @SneakyThrows public void testScanCommandMessage() { - when(meterRegistry.counter(any(), any(), any(), any(), any(), any(), any())).thenReturn(new NoopCounter( + when(meterRegistry.counter(any(), any(String[].class))).thenReturn(new NoopCounter( new Meter.Id("mockMeterId", null, null, null, null))); ScanCommandMessageHandler scanCommandMessageHandler = new ScanCommandMessageHandler( solaceConfiguration, solaceSubscriber, scanCommandMessageProcessor, meterRegistry);