@Test public void testListEnvironments() throws Exception { when(mapper.toListEnvironmentsRequest(context, CLUSTER, ENVIRONMENT_NAME_PREFIX)) .thenReturn(dsRequest); when(dataService.listEnvironments(dsRequest)).thenReturn(dsResponse); when(mapper.fromDataServiceResponse(dsResponse)).thenReturn(feResponse); final ListEnvironments.ListEnvironmentsResponse response = api.listEnvironments(CLUSTER, ENVIRONMENT_NAME_PREFIX, pagination); assertThat(response).isEqualTo(feResponse); verify(mapper).toListEnvironmentsRequest(context, CLUSTER, ENVIRONMENT_NAME_PREFIX); verify(dataService).listEnvironments(dsRequest); verify(mapper).fromDataServiceResponse(dsResponse); }
@RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") public ListEnvironmentsResponse listEnvironments( @PathVariable("cluster") String cluster, @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix, @ModelAttribute RequestPagination pagination) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.listEnvironments( mapper.toListEnvironmentsRequest( getApiGatewayRequestContext(), cluster, environmentNamePrefix))); }
ListEnvironments extends EnvironmentController { @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") public ListEnvironmentsResponse listEnvironments( @PathVariable("cluster") String cluster, @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix, @ModelAttribute RequestPagination pagination) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.listEnvironments( mapper.toListEnvironmentsRequest( getApiGatewayRequestContext(), cluster, environmentNamePrefix))); } }
ListEnvironments extends EnvironmentController { @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") public ListEnvironmentsResponse listEnvironments( @PathVariable("cluster") String cluster, @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix, @ModelAttribute RequestPagination pagination) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.listEnvironments( mapper.toListEnvironmentsRequest( getApiGatewayRequestContext(), cluster, environmentNamePrefix))); }  }
ListEnvironments extends EnvironmentController { @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") public ListEnvironmentsResponse listEnvironments( @PathVariable("cluster") String cluster, @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix, @ModelAttribute RequestPagination pagination) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.listEnvironments( mapper.toListEnvironmentsRequest( getApiGatewayRequestContext(), cluster, environmentNamePrefix))); }  @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") ListEnvironmentsResponse listEnvironments(
      @PathVariable("cluster") String cluster,
      @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix,
      @ModelAttribute RequestPagination pagination); }
ListEnvironments extends EnvironmentController { @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") public ListEnvironmentsResponse listEnvironments( @PathVariable("cluster") String cluster, @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix, @ModelAttribute RequestPagination pagination) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.listEnvironments( mapper.toListEnvironmentsRequest( getApiGatewayRequestContext(), cluster, environmentNamePrefix))); }  @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "List all environments") ListEnvironmentsResponse listEnvironments(
      @PathVariable("cluster") String cluster,
      @RequestParam(value = "environmentNamePrefix", required = false) String environmentNamePrefix,
      @ModelAttribute RequestPagination pagination);  }