/** * Handles an event of type {@link AgentRegisteredEvent}. * * @param event * the event instance */ private void handleAgentRegisteredEvent(AgentRegisteredEvent event) { clear(event.getPlatformId()); }
/** * Handles an event of type {@link AgentDeletedEvent}. * * @param event * the event instance */ private void handleAgentDeletedEvent(AgentDeletedEvent event) { clear(event.getPlatformId()); }
@Test public void successful() throws Exception { when(definition.getClassName()).thenReturn("class.one"); ClassInstrumentationChangedEvent event = new ClassInstrumentationChangedEvent(this, 10L, Arrays.asList(definition)); messageGate.onApplicationEvent(event); messageGate.clear(10L); verifyZeroInteractions(messageProvider); assertThat(getDefinitionBuffer().get(10L).entrySet(), hasSize(0)); }
@Test public void unknownPlatformId() throws Exception { when(definition.getClassName()).thenReturn("class.one"); ClassInstrumentationChangedEvent event = new ClassInstrumentationChangedEvent(this, 10L, Arrays.asList(definition)); messageGate.onApplicationEvent(event); messageGate.clear(20L); verifyZeroInteractions(messageProvider); assertThat(getDefinitionBuffer().get(10L).entrySet(), hasSize(1)); } }