SystemPauseStepCmd extends StepCommand { @Override protected void execute() throws ApiFeException, InterruptedException, RpcException { try { logger.info("Pausing APIFE service..."); DeploymentService.State state = new DeploymentService.State(); state.state = DeploymentState.PAUSED; state.documentSelfLink = DeploymentServiceFactory.SELF_LINK + "/" + deploymentId; com.vmware.xenon.common.Operation operation = taskCommand.getApiFeXenonRestClient().patch(state.documentSelfLink, state, EnumSet.of(XenonClient.HeaderOption.HEADER_OPTION_FULL_QUORUM)); logger.info("Paused APIFE service..."); } catch (DocumentNotFoundException ex) { throw new InternalException(ex); } } SystemPauseStepCmd(TaskCommand taskCommand,
                            StepBackend stepBackend,
                            StepEntity step
                            );  static final String DEPLOYMENT_ID_RESOURCE_KEY; }
@Test public void testSuccess() throws Throwable { command.execute(); DeploymentEntity deploymentEntity = deploymentBackend.findById(initialDeploymentEntity.getId()); assertEquals(deploymentEntity.getState(), DeploymentState.PAUSED); }
@Test(expectedExceptions = InternalException.class) public void testError() throws Throwable { step = new StepEntity(); step.setId("step-1"); command = spy(new SystemPauseStepCmd(taskCommand, stepBackend, step)); command.execute(); }