@Test public void testNotAbstractChannelEvent() throws Exception { JmsTemplate jmsTemplate = Mockito.mock(JmsTemplate.class); ContentConverter contentConverter = Mockito.mock(ContentConverter.class); Mockito.doNothing().when(jmsTemplate).convertAndSend(Mockito.anyString(), Mockito.any(Object.class)); EventManager eventManager = new EventManager(contentConverter, jmsTemplate); LinkableItem subTopic = new LinkableItem("subTopic", "sub topic", null); ProviderMessageContent content = new ProviderMessageContent.Builder() .applyProvider("1", 1L, "providerConfig") .applyTopic("testTopic", "topic") .applySubTopic(subTopic.getName(), subTopic.getValue()) .build(); AlertEvent dbStoreEvent = new ContentEvent("", RestConstants.formatDate(new Date()), 1L, "FORMAT", MessageContentGroup.singleton(content)); eventManager.sendEvent(dbStoreEvent); }
@Transactional public void sendEvent(AlertEvent event) { String destination = event.getDestination(); String jsonMessage = contentConverter.getJsonString(event); jmsTemplate.convertAndSend(destination, jsonMessage); }
EventManager { @Transactional public void sendEvent(AlertEvent event) { String destination = event.getDestination(); String jsonMessage = contentConverter.getJsonString(event); jmsTemplate.convertAndSend(destination, jsonMessage); } }
EventManager { @Transactional public void sendEvent(AlertEvent event) { String destination = event.getDestination(); String jsonMessage = contentConverter.getJsonString(event); jmsTemplate.convertAndSend(destination, jsonMessage); } @Autowired  EventManager(ContentConverter contentConverter, JmsTemplate jmsTemplate); }
EventManager { @Transactional public void sendEvent(AlertEvent event) { String destination = event.getDestination(); String jsonMessage = contentConverter.getJsonString(event); jmsTemplate.convertAndSend(destination, jsonMessage); } @Autowired  EventManager(ContentConverter contentConverter, JmsTemplate jmsTemplate); @Transactional void sendEvents(List<? extends AlertEvent> eventList); @Transactional void sendEvent(AlertEvent event); JmsTemplate getJmsTemplate(); ContentConverter getContentConverter(); }
EventManager { @Transactional public void sendEvent(AlertEvent event) { String destination = event.getDestination(); String jsonMessage = contentConverter.getJsonString(event); jmsTemplate.convertAndSend(destination, jsonMessage); } @Autowired  EventManager(ContentConverter contentConverter, JmsTemplate jmsTemplate); @Transactional void sendEvents(List<? extends AlertEvent> eventList); @Transactional void sendEvent(AlertEvent event); JmsTemplate getJmsTemplate(); ContentConverter getContentConverter();  }