@Test public void successful() throws Exception { Type type = mock(Type.class); agentService.analyze(10, "hash", type); verify(instrumentationManager).analyze(10L, "hash", type); verifyNoMoreInteractions(instrumentationManager); verifyZeroInteractions(messageProvider); } }
@Test @SuppressWarnings("unchecked") public void successful() throws Exception { List<JmxAttributeDescriptor> attributeDescriptors = mock(List.class); agentService.analyzeJmxAttributes(10L, attributeDescriptors); verify(instrumentationManager).analyzeJmxAttributes(10L, attributeDescriptors); verifyNoMoreInteractions(instrumentationManager); verifyZeroInteractions(messageProvider, attributeDescriptors); } }
@Test public void successful() throws Exception { agentService.fetchAgentMessages(10L); verify(messageProvider).fetchMessages(10L); verifyNoMoreInteractions(messageProvider); verifyZeroInteractions(instrumentationManager); } }
@Test @SuppressWarnings("unchecked") public void successful() throws Exception { Map<Long, long[]> methodSensorMap = mock(Map.class); agentService.instrumentationApplied(10L, methodSensorMap); verify(instrumentationManager).instrumentationApplied(10L, methodSensorMap); verifyNoMoreInteractions(instrumentationManager); verifyZeroInteractions(messageProvider, methodSensorMap); } }
@Test public void successful() throws Exception { agentService.unregister(10L); verify(instrumentationManager).unregister(10L); verifyNoMoreInteractions(instrumentationManager); verifyZeroInteractions(messageProvider); } }
@Test @SuppressWarnings("unchecked") public void successful() throws Exception { List<String> definedIPs = mock(List.class); when(instrumentationManager.register(any(List.class), any(String.class), any(String.class))).thenReturn(agentConfig); when(agentConfig.getPlatformId()).thenReturn(10L); agentService.register(definedIPs, "name", "version"); verify(instrumentationManager).register(definedIPs, "name", "version"); verifyNoMoreInteractions(instrumentationManager, messageProvider); verifyZeroInteractions(messageProvider, definedIPs); } }