@Test public void get() throws Exception { List<CommandRestController.JsonClientMapping> commands = testSubject.get(null); ObjectMapper mapper = new ObjectMapper(); assertNotEquals("[]", mapper.writeValueAsString(commands)); }
@GetMapping("commands") public List<JsonClientMapping> get(Principal principal) { auditLog.info("[{}] Request to list all Commands which have a registered handler.", AuditLog.username(principal)); return registrationCache.getAll().entrySet().stream().map(JsonClientMapping::from).collect(Collectors.toList()); }
CommandRestController { @GetMapping("commands") public List<JsonClientMapping> get(Principal principal) { auditLog.info("[{}] Request to list all Commands which have a registered handler.", AuditLog.username(principal)); return registrationCache.getAll().entrySet().stream().map(JsonClientMapping::from).collect(Collectors.toList()); } }
CommandRestController { @GetMapping("commands") public List<JsonClientMapping> get(Principal principal) { auditLog.info("[{}] Request to list all Commands which have a registered handler.", AuditLog.username(principal)); return registrationCache.getAll().entrySet().stream().map(JsonClientMapping::from).collect(Collectors.toList()); } CommandRestController(CommandDispatcher commandDispatcher, CommandRegistrationCache registrationCache); }
CommandRestController { @GetMapping("commands") public List<JsonClientMapping> get(Principal principal) { auditLog.info("[{}] Request to list all Commands which have a registered handler.", AuditLog.username(principal)); return registrationCache.getAll().entrySet().stream().map(JsonClientMapping::from).collect(Collectors.toList()); } CommandRestController(CommandDispatcher commandDispatcher, CommandRegistrationCache registrationCache); @GetMapping("/components/{component}/commands") Iterable<ComponentCommand> getByComponent(@PathVariable("component") String component, @RequestParam("context") String context, Principal principal); @GetMapping("commands") List<JsonClientMapping> get(Principal principal); @PostMapping("commands/run") @ApiImplicitParams({ @ApiImplicitParam(name = TOKEN_PARAM, value = "Access Token", required = false, dataType = "string", paramType = "header") }) Future<CommandResponseJson> execute(@RequestHeader(value = CONTEXT_PARAM, defaultValue = Topology.DEFAULT_CONTEXT, required = false) String context,
                                               @RequestBody @Valid CommandRequestJson command, Principal principal); @GetMapping("commands/queues") List<JsonQueueInfo> queues(Principal principal); @GetMapping("commands/count") int count(Principal principal); }
CommandRestController { @GetMapping("commands") public List<JsonClientMapping> get(Principal principal) { auditLog.info("[{}] Request to list all Commands which have a registered handler.", AuditLog.username(principal)); return registrationCache.getAll().entrySet().stream().map(JsonClientMapping::from).collect(Collectors.toList()); } CommandRestController(CommandDispatcher commandDispatcher, CommandRegistrationCache registrationCache); @GetMapping("/components/{component}/commands") Iterable<ComponentCommand> getByComponent(@PathVariable("component") String component, @RequestParam("context") String context, Principal principal); @GetMapping("commands") List<JsonClientMapping> get(Principal principal); @PostMapping("commands/run") @ApiImplicitParams({ @ApiImplicitParam(name = TOKEN_PARAM, value = "Access Token", required = false, dataType = "string", paramType = "header") }) Future<CommandResponseJson> execute(@RequestHeader(value = CONTEXT_PARAM, defaultValue = Topology.DEFAULT_CONTEXT, required = false) String context,
                                               @RequestBody @Valid CommandRequestJson command, Principal principal); @GetMapping("commands/queues") List<JsonQueueInfo> queues(Principal principal); @GetMapping("commands/count") int count(Principal principal);  }