@Test public void testAccessPublishEvent() { BaseTransactionEvent mockEvent = mock(BaseTransactionEvent.class); GlobalTransaction globalTransaction = mock(GlobalTransaction.class); String gtx = "2c95e0816916dd9a016916de13d90002"; when(globalTransactionRepository.findById(gtx)).thenReturn(Optional.of(globalTransaction)); businessFlowUt.access(gtx, mockEvent); verify(publisher, times(1)).publishEvent(mockEvent); }
public <T extends BaseTransactionEvent> void access(String gtx, T event){ globalTransactionRepository.findById(gtx).ifPresent( globalTransaction -> { bubbleCache.addBubble(event.getId(), new BubbleMessage(gtx, null)); publisher.publishEvent(event); }); }
BusinessFlow { public <T extends BaseTransactionEvent> void access(String gtx, T event){ globalTransactionRepository.findById(gtx).ifPresent( globalTransaction -> { bubbleCache.addBubble(event.getId(), new BubbleMessage(gtx, null)); publisher.publishEvent(event); }); } }
BusinessFlow { public <T extends BaseTransactionEvent> void access(String gtx, T event){ globalTransactionRepository.findById(gtx).ifPresent( globalTransaction -> { bubbleCache.addBubble(event.getId(), new BubbleMessage(gtx, null)); publisher.publishEvent(event); }); } @Autowired  BusinessFlow(ApplicationEventPublisher publisher, GlobalTransactionRepository globalTransactionRepository, BubbleCache bubbleCache); }
BusinessFlow { public <T extends BaseTransactionEvent> void access(String gtx, T event){ globalTransactionRepository.findById(gtx).ifPresent( globalTransaction -> { bubbleCache.addBubble(event.getId(), new BubbleMessage(gtx, null)); publisher.publishEvent(event); }); } @Autowired  BusinessFlow(ApplicationEventPublisher publisher, GlobalTransactionRepository globalTransactionRepository, BubbleCache bubbleCache); void access(String gtx, T event); }
BusinessFlow { public <T extends BaseTransactionEvent> void access(String gtx, T event){ globalTransactionRepository.findById(gtx).ifPresent( globalTransaction -> { bubbleCache.addBubble(event.getId(), new BubbleMessage(gtx, null)); publisher.publishEvent(event); }); } @Autowired  BusinessFlow(ApplicationEventPublisher publisher, GlobalTransactionRepository globalTransactionRepository, BubbleCache bubbleCache); void access(String gtx, T event);  }