@Test public void shouldGet() throws Exception { ProgramColumnTemplateDTO dto = new ProgramColumnTemplateDTO(); List<LogisticsColumn> columns = asList(new LogisticsColumn()); dto.setColumns(columns); when(service.getTemplate(1L)).thenReturn(dto); ResponseEntity<OpenLmisResponse> response = controller.get(1L); assertThat(dto, is(response.getBody().getData().get("columns"))); }
@RequestMapping(value = "get/{programId}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId) { return OpenLmisResponse.response(COLUMNS, service.getTemplate(programId)); }
VaccineColumnTemplateController extends BaseController { @RequestMapping(value = "get/{programId}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId) { return OpenLmisResponse.response(COLUMNS, service.getTemplate(programId)); } }
VaccineColumnTemplateController extends BaseController { @RequestMapping(value = "get/{programId}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId) { return OpenLmisResponse.response(COLUMNS, service.getTemplate(programId)); }  }
VaccineColumnTemplateController extends BaseController { @RequestMapping(value = "get/{programId}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId) { return OpenLmisResponse.response(COLUMNS, service.getTemplate(programId)); }  @RequestMapping(value = "get/{programId}") ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId); @RequestMapping(value="save") ResponseEntity<OpenLmisResponse> save(@RequestBody ProgramColumnTemplateDTO programColumnDTO); @RequestMapping(value = "get/columns") ResponseEntity<OpenLmisResponse> getAll(); }
VaccineColumnTemplateController extends BaseController { @RequestMapping(value = "get/{programId}") public ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId) { return OpenLmisResponse.response(COLUMNS, service.getTemplate(programId)); }  @RequestMapping(value = "get/{programId}") ResponseEntity<OpenLmisResponse> get(@PathVariable Long programId); @RequestMapping(value="save") ResponseEntity<OpenLmisResponse> save(@RequestBody ProgramColumnTemplateDTO programColumnDTO); @RequestMapping(value = "get/columns") ResponseEntity<OpenLmisResponse> getAll(); static final String COLUMNS; }