@Test public void shouldGetAllChannels() { List<ChannelDto> expected = new ArrayList<>(); expected.add(new ChannelDto()); expected.add(new ChannelDto()); expected.add(new ChannelDto()); when(taskWebService.getAllChannels()).thenReturn(expected); List<ChannelDto> actual = controller.getAllChannels(); verify(taskWebService).getAllChannels(); assertNotNull(actual); assertEquals(expected, actual); }
@RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody public List<ChannelDto> getAllChannels() { return taskWebService.getAllChannels(); }
ChannelController { @RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody public List<ChannelDto> getAllChannels() { return taskWebService.getAllChannels(); } }
ChannelController { @RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody public List<ChannelDto> getAllChannels() { return taskWebService.getAllChannels(); } @Autowired  ChannelController(TaskWebService taskWebService, TriggerEventService triggerEventService); }
ChannelController { @RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody public List<ChannelDto> getAllChannels() { return taskWebService.getAllChannels(); } @Autowired  ChannelController(TaskWebService taskWebService, TriggerEventService triggerEventService); @RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody List<ChannelDto> getAllChannels(); @RequestMapping(value = "channel/triggers", method = RequestMethod.GET) @ResponseBody TriggersLists getTriggers(@RequestParam String moduleName,
                                     @RequestParam int staticTriggersPage,
                                     @RequestParam int dynamicTriggersPage); @RequestMapping(value = "channel/trigger", method = RequestMethod.POST) @ResponseBody TriggerEventDto getTrigger(@RequestBody TaskTriggerInformation info); }
ChannelController { @RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody public List<ChannelDto> getAllChannels() { return taskWebService.getAllChannels(); } @Autowired  ChannelController(TaskWebService taskWebService, TriggerEventService triggerEventService); @RequestMapping(value = "channel", method = RequestMethod.GET) @ResponseBody List<ChannelDto> getAllChannels(); @RequestMapping(value = "channel/triggers", method = RequestMethod.GET) @ResponseBody TriggersLists getTriggers(@RequestParam String moduleName,
                                     @RequestParam int staticTriggersPage,
                                     @RequestParam int dynamicTriggersPage); @RequestMapping(value = "channel/trigger", method = RequestMethod.POST) @ResponseBody TriggerEventDto getTrigger(@RequestBody TaskTriggerInformation info);  }