@Test public void shouldGetSupervisoryNodeById() { Long id = 1L; SupplyLine expectedSupplyLine = new SupplyLine(); Mockito.when(service.getById(id)).thenReturn(expectedSupplyLine); SupplyLine supplyLine = controller.getById(id); verify(service).getById(id); assertThat(supplyLine, CoreMatchers.is(expectedSupplyLine)); }
@RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") public SupplyLine getById(@PathVariable(value = "id") Long id) { return service.getById(id); }
SupplyLineController extends BaseController { @RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") public SupplyLine getById(@PathVariable(value = "id") Long id) { return service.getById(id); } }
SupplyLineController extends BaseController { @RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") public SupplyLine getById(@PathVariable(value = "id") Long id) { return service.getById(id); }  }
SupplyLineController extends BaseController { @RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") public SupplyLine getById(@PathVariable(value = "id") Long id) { return service.getById(id); }  @RequestMapping(value = "/search", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") ResponseEntity<OpenLmisResponse> search(@RequestParam(value = "searchParam") String searchParam,
                                                 @RequestParam(value = "column") String column,
                                                 @RequestParam(value = "page", defaultValue = "1") Integer page,
                                                 @Value("${search.page.size}") String limit); @RequestMapping(method = POST, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") ResponseEntity<OpenLmisResponse> insert(@RequestBody SupplyLine supplyLine,
                                                 HttpServletRequest request); @RequestMapping(value = "/{id}", method = PUT, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") ResponseEntity<OpenLmisResponse> update(@RequestBody SupplyLine supplyLine,
                                                 @PathVariable(value = "id") Long supervisoryNodeId,
                                                 HttpServletRequest request); @RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") SupplyLine getById(@PathVariable(value = "id") Long id); @RequestMapping(value = "/supplying-depots.json", method = GET, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> getSupplyingDepots(HttpServletRequest request); }
SupplyLineController extends BaseController { @RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") public SupplyLine getById(@PathVariable(value = "id") Long id) { return service.getById(id); }  @RequestMapping(value = "/search", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") ResponseEntity<OpenLmisResponse> search(@RequestParam(value = "searchParam") String searchParam,
                                                 @RequestParam(value = "column") String column,
                                                 @RequestParam(value = "page", defaultValue = "1") Integer page,
                                                 @Value("${search.page.size}") String limit); @RequestMapping(method = POST, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") ResponseEntity<OpenLmisResponse> insert(@RequestBody SupplyLine supplyLine,
                                                 HttpServletRequest request); @RequestMapping(value = "/{id}", method = PUT, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") ResponseEntity<OpenLmisResponse> update(@RequestBody SupplyLine supplyLine,
                                                 @PathVariable(value = "id") Long supervisoryNodeId,
                                                 HttpServletRequest request); @RequestMapping(value = "/{id}", method = GET) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SUPPLY_LINE')") SupplyLine getById(@PathVariable(value = "id") Long id); @RequestMapping(value = "/supplying-depots.json", method = GET, headers = ACCEPT_JSON) ResponseEntity<OpenLmisResponse> getSupplyingDepots(HttpServletRequest request); static final String SUPPLY_LINES; static final String PAGINATION; static final String SUPPLYLINES; static final String SUPPLY_LINE_ID; }