@Test public void sendSeckillSuccessTopic() { long seckillId = 1L; activeMqMessageSender.sendSeckillSuccessTopic(seckillId,"test"); verify(jmsTopicTemplate, only()).send(any()); verify(seckillService, only()).getSuccessKillCount(seckillId); }
public void sendSeckillSuccessTopic(long seckillId, String note) { seckillService.getSuccessKillCount(seckillId); long finalSeckillId = seckillId; jmsTopicTemplate.send(session -> { Message message = session.createMessage(); message.setLongProperty("seckillId", finalSeckillId); message.setBooleanProperty("status", true); message.setStringProperty("note", note); return message; }); }
ActiveMqMessageSender { public void sendSeckillSuccessTopic(long seckillId, String note) { seckillService.getSuccessKillCount(seckillId); long finalSeckillId = seckillId; jmsTopicTemplate.send(session -> { Message message = session.createMessage(); message.setLongProperty("seckillId", finalSeckillId); message.setBooleanProperty("status", true); message.setStringProperty("note", note); return message; }); } }
ActiveMqMessageSender { public void sendSeckillSuccessTopic(long seckillId, String note) { seckillService.getSuccessKillCount(seckillId); long finalSeckillId = seckillId; jmsTopicTemplate.send(session -> { Message message = session.createMessage(); message.setLongProperty("seckillId", finalSeckillId); message.setBooleanProperty("status", true); message.setStringProperty("note", note); return message; }); }  }
ActiveMqMessageSender { public void sendSeckillSuccessTopic(long seckillId, String note) { seckillService.getSuccessKillCount(seckillId); long finalSeckillId = seckillId; jmsTopicTemplate.send(session -> { Message message = session.createMessage(); message.setLongProperty("seckillId", finalSeckillId); message.setBooleanProperty("status", true); message.setStringProperty("note", note); return message; }); }  void sendSeckillSuccessTopic(long seckillId, String note); }
ActiveMqMessageSender { public void sendSeckillSuccessTopic(long seckillId, String note) { seckillService.getSuccessKillCount(seckillId); long finalSeckillId = seckillId; jmsTopicTemplate.send(session -> { Message message = session.createMessage(); message.setLongProperty("seckillId", finalSeckillId); message.setBooleanProperty("status", true); message.setStringProperty("note", note); return message; }); }  void sendSeckillSuccessTopic(long seckillId, String note);  }