@Test public void testStartDeployment() throws Exception { final StartDeploymentRequest dsRequest = mock(StartDeploymentRequest.class); final StartDeploymentResponse dsResponse = mock(StartDeploymentResponse.class); final StartDeployment.StartDeploymentResponse feResponse = mock(StartDeployment.StartDeploymentResponse.class); when(mapper.toDataServiceRequest(context, CLUSTER, ENVIRONMENT_NAME, ENVIRONMENT_REVISION_ID)) .thenReturn(dsRequest); when(dataService.startDeployment(dsRequest)).thenReturn(dsResponse); when(mapper.fromDataServiceResponse(dsResponse)).thenReturn(feResponse); final StartDeployment.StartDeploymentResponse response = api.startDeployment(CLUSTER, ENVIRONMENT_NAME, ENVIRONMENT_REVISION_ID); assertThat(response).isEqualTo(feResponse); verify(mapper) .toDataServiceRequest(context, CLUSTER, ENVIRONMENT_NAME, ENVIRONMENT_REVISION_ID); verify(dataService).startDeployment(dsRequest); verify(mapper).fromDataServiceResponse(dsResponse); }
@RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") public StartDeploymentResponse startDeployment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestParam("revisionId") String revisionId) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.startDeployment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, revisionId))); }
StartDeployment extends EnvironmentController { @RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") public StartDeploymentResponse startDeployment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestParam("revisionId") String revisionId) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.startDeployment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, revisionId))); } }
StartDeployment extends EnvironmentController { @RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") public StartDeploymentResponse startDeployment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestParam("revisionId") String revisionId) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.startDeployment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, revisionId))); }  }
StartDeployment extends EnvironmentController { @RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") public StartDeploymentResponse startDeployment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestParam("revisionId") String revisionId) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.startDeployment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, revisionId))); }  @RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") StartDeploymentResponse startDeployment(
      @PathVariable("cluster") String cluster,
      @PathVariable("environmentName") String environmentName,
      @RequestParam("revisionId") String revisionId); }
StartDeployment extends EnvironmentController { @RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") public StartDeploymentResponse startDeployment( @PathVariable("cluster") String cluster, @PathVariable("environmentName") String environmentName, @RequestParam("revisionId") String revisionId) throws ServiceException, ClientException { return mapper.fromDataServiceResponse( dataService.startDeployment( mapper.toDataServiceRequest( getApiGatewayRequestContext(), cluster, environmentName, revisionId))); }  @RequestMapping(path = "/{environmentName}/deployments", method = RequestMethod.POST) @ApiOperation(value = "Deploy Environment revision") StartDeploymentResponse startDeployment(
      @PathVariable("cluster") String cluster,
      @PathVariable("environmentName") String environmentName,
      @RequestParam("revisionId") String revisionId);  }