@Test public void mapsInputsAndOutputsCorrectly() throws Exception { EnvironmentId id = EnvironmentId.builder() .accountId(ACCOUNT_ID) .cluster(TEST_CLUSTER) .environmentName(ENVIRONMENT_NAME) .build(); when(dataService.updateEnvironment(any())) .thenReturn( com.amazonaws.blox.dataservicemodel.v1.model.wrappers.UpdateEnvironmentResponse .builder() .environmentRevisionId(ENVIRONMENT_REVISION_ID) .build()); UpdateEnvironmentResponse response = controller.updateEnvironment( TEST_CLUSTER, ENVIRONMENT_NAME, UpdateEnvironmentRequest.builder().taskDefinition(NEW_TASK_DEFINITION).build()); verify(dataService) .updateEnvironment( com.amazonaws.blox.dataservicemodel.v1.model.wrappers.UpdateEnvironmentRequest.builder() .environmentId(id) .taskDefinition(NEW_TASK_DEFINITION) .build()); assertThat(response).isNotNull(); assertThat(response.getEnvironmentRevisionId()).isEqualTo(ENVIRONMENT_REVISION_ID); }
@RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") public UpdateEnvironmentResponse updateEnvironment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestBody UpdateEnvironmentRequest request) throws InvalidParameterException, ServiceException, ResourceNotFoundException, ResourceExistsException { return mapper.fromDataServiceResponse( dataService.updateEnvironment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, request))); }
UpdateEnvironment extends EnvironmentController { @RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") public UpdateEnvironmentResponse updateEnvironment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestBody UpdateEnvironmentRequest request) throws InvalidParameterException, ServiceException, ResourceNotFoundException, ResourceExistsException { return mapper.fromDataServiceResponse( dataService.updateEnvironment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, request))); } }
UpdateEnvironment extends EnvironmentController { @RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") public UpdateEnvironmentResponse updateEnvironment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestBody UpdateEnvironmentRequest request) throws InvalidParameterException, ServiceException, ResourceNotFoundException, ResourceExistsException { return mapper.fromDataServiceResponse( dataService.updateEnvironment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, request))); }  }
UpdateEnvironment extends EnvironmentController { @RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") public UpdateEnvironmentResponse updateEnvironment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestBody UpdateEnvironmentRequest request) throws InvalidParameterException, ServiceException, ResourceNotFoundException, ResourceExistsException { return mapper.fromDataServiceResponse( dataService.updateEnvironment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, request))); }  @RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") UpdateEnvironmentResponse updateEnvironment(
      @PathVariable("cluster") String cluster,
      @PathVariable("environmentName") String environmentName,
      @RequestBody UpdateEnvironmentRequest request); }
UpdateEnvironment extends EnvironmentController { @RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") public UpdateEnvironmentResponse updateEnvironment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestBody UpdateEnvironmentRequest request) throws InvalidParameterException, ServiceException, ResourceNotFoundException, ResourceExistsException { return mapper.fromDataServiceResponse( dataService.updateEnvironment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, request))); }  @RequestMapping( path = "/{environmentName}", method = RequestMethod.PUT, consumes = "application/json" ) @ApiOperation(value = "Update an existing Environment") UpdateEnvironmentResponse updateEnvironment(
      @PathVariable("cluster") String cluster,
      @PathVariable("environmentName") String environmentName,
      @RequestBody UpdateEnvironmentRequest request);  }