@Test void getAllBeaconsTest() throws Exception { List<BeaconDatasetResponse> beaconDatasets = newArrayList(BeaconDatasetResponse.create("dataset", "DATA", "")); BeaconResponse beaconResponse = BeaconResponse.create("beaconA", "beacon A", "0.3.0", null, "", "", "", beaconDatasets); when(beaconInfoService.getAvailableBeacons()).thenReturn(Lists.newArrayList(beaconResponse)); mockMvc .perform(get("/beacon/list")) .andExpect(status().isOk()) .andExpect(content().contentType(APPLICATION_JSON_UTF8)) .andExpect(content().string(getBeaconResponseListAsJson())); verify(beaconInfoService).getAvailableBeacons(); }
@ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") public List<BeaconResponse> getAllBeacons() { return beaconInfoService.getAvailableBeacons(); }
BeaconController { @ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") public List<BeaconResponse> getAllBeacons() { return beaconInfoService.getAvailableBeacons(); } }
BeaconController { @ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") public List<BeaconResponse> getAllBeacons() { return beaconInfoService.getAvailableBeacons(); } BeaconController(BeaconInfoService beaconInfoService, BeaconQueryService beaconQueryService); }
BeaconController { @ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") public List<BeaconResponse> getAllBeacons() { return beaconInfoService.getAvailableBeacons(); } BeaconController(BeaconInfoService beaconInfoService, BeaconQueryService beaconQueryService); @ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") List<BeaconResponse> getAllBeacons(); @ResponseBody @GetMapping(value = "/{beaconId}", produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Retrieve info on one beacon", response = BeaconResponse.class) BeaconResponse info(@PathVariable("beaconId") final String beaconId); @ResponseBody @GetMapping(value = "/{beaconId}/query", produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Query a beacon via a GET request", response = BeaconAlleleResponse.class) BeaconAlleleResponse query(
      @RequestParam("referenceName") String referenceName,
      @RequestParam("start") Long start,
      @RequestParam("referenceBases") String referenceBases,
      @RequestParam("alternateBases") String alternateBases,
      @PathVariable("beaconId") final String beaconId); @ResponseBody @PostMapping(value = "/{beaconId}/query", produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Query a beacon via a POST request", response = BeaconAlleleResponse.class) BeaconAlleleResponse query(
      @PathVariable("beaconId") final String beaconId, @RequestBody BeaconAlleleRequest request); }
BeaconController { @ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") public List<BeaconResponse> getAllBeacons() { return beaconInfoService.getAvailableBeacons(); } BeaconController(BeaconInfoService beaconInfoService, BeaconQueryService beaconQueryService); @ResponseBody @GetMapping(value = "/list", produces = APPLICATION_JSON_VALUE) @ApiOperation( value = "List all beacons", response = BeaconResponse.class, responseContainer = "List") List<BeaconResponse> getAllBeacons(); @ResponseBody @GetMapping(value = "/{beaconId}", produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Retrieve info on one beacon", response = BeaconResponse.class) BeaconResponse info(@PathVariable("beaconId") final String beaconId); @ResponseBody @GetMapping(value = "/{beaconId}/query", produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Query a beacon via a GET request", response = BeaconAlleleResponse.class) BeaconAlleleResponse query(
      @RequestParam("referenceName") String referenceName,
      @RequestParam("start") Long start,
      @RequestParam("referenceBases") String referenceBases,
      @RequestParam("alternateBases") String alternateBases,
      @PathVariable("beaconId") final String beaconId); @ResponseBody @PostMapping(value = "/{beaconId}/query", produces = APPLICATION_JSON_VALUE) @ApiOperation(value = "Query a beacon via a POST request", response = BeaconAlleleResponse.class) BeaconAlleleResponse query(
      @PathVariable("beaconId") final String beaconId, @RequestBody BeaconAlleleRequest request); static final String URI; }