@Test void payloadStringIsUsedAsItIs() throws Exception { toKafkaSenderService.sendMessage(new SendMessageRequest().setPayloadString("abc")); verify(objectMapper, never()).writeValueAsString(anyString()); verify(taskService).addTask(any()); }
@Override @Transactional(rollbackFor = Exception.class) public void sendMessage(SendMessageRequest request) { ToKafkaMessages messages = new ToKafkaMessages().setTopic(request.getTopic()).add(convert(request)); taskService.addTask(new ITasksService.AddTaskRequest().setType(ToKafkaTaskType.VALUE).setSubType(messages.getTopic()).setData(messages) .setRunAfterTime(request.getSendAfterTime())); }
ToKafkaSenderService implements IToKafkaSenderService { @Override @Transactional(rollbackFor = Exception.class) public void sendMessage(SendMessageRequest request) { ToKafkaMessages messages = new ToKafkaMessages().setTopic(request.getTopic()).add(convert(request)); taskService.addTask(new ITasksService.AddTaskRequest().setType(ToKafkaTaskType.VALUE).setSubType(messages.getTopic()).setData(messages) .setRunAfterTime(request.getSendAfterTime())); } }
ToKafkaSenderService implements IToKafkaSenderService { @Override @Transactional(rollbackFor = Exception.class) public void sendMessage(SendMessageRequest request) { ToKafkaMessages messages = new ToKafkaMessages().setTopic(request.getTopic()).add(convert(request)); taskService.addTask(new ITasksService.AddTaskRequest().setType(ToKafkaTaskType.VALUE).setSubType(messages.getTopic()).setData(messages) .setRunAfterTime(request.getSendAfterTime())); }  }
ToKafkaSenderService implements IToKafkaSenderService { @Override @Transactional(rollbackFor = Exception.class) public void sendMessage(SendMessageRequest request) { ToKafkaMessages messages = new ToKafkaMessages().setTopic(request.getTopic()).add(convert(request)); taskService.addTask(new ITasksService.AddTaskRequest().setType(ToKafkaTaskType.VALUE).setSubType(messages.getTopic()).setData(messages) .setRunAfterTime(request.getSendAfterTime())); }  @Override @Transactional(rollbackFor = Exception.class) void sendMessage(SendMessageRequest request); @Override @Transactional(rollbackFor = Exception.class) void sendMessages(SendMessagesRequest request); }
ToKafkaSenderService implements IToKafkaSenderService { @Override @Transactional(rollbackFor = Exception.class) public void sendMessage(SendMessageRequest request) { ToKafkaMessages messages = new ToKafkaMessages().setTopic(request.getTopic()).add(convert(request)); taskService.addTask(new ITasksService.AddTaskRequest().setType(ToKafkaTaskType.VALUE).setSubType(messages.getTopic()).setData(messages) .setRunAfterTime(request.getSendAfterTime())); }  @Override @Transactional(rollbackFor = Exception.class) void sendMessage(SendMessageRequest request); @Override @Transactional(rollbackFor = Exception.class) void sendMessages(SendMessagesRequest request);  }