### Question:
DockerContainerOperationManager { @Async("pauseRunExecutor") public void resumeRun(PipelineRun run, List<String> endpoints) { try { final AbstractCloudRegion cloudRegion = regionManager.load(run.getInstance().getCloudRegionId()); final CloudInstanceOperationResult startInstanceResult = cloudFacade.startInstance(cloudRegion.getId(), run.getInstance().getNodeId()); if (startInstanceResult.getStatus() != CloudInstanceOperationResult.Status.OK) { rollbackRunToPausedState(run, startInstanceResult); return; } kubernetesManager.waitForNodeReady(run.getInstance().getNodeName(), run.getId().toString(), cloudRegion.getRegionCode()); PipelineConfiguration configuration = getResumeConfiguration(run); launcher.launch(run, configuration, endpoints, run.getId().toString(), true, run.getPodId(), null, false); kubernetesManager.removeNodeLabel(run.getInstance().getNodeName(), KubernetesConstants.PAUSED_NODE_LABEL); run.setStatus(TaskStatus.RUNNING); runManager.updatePipelineStatus(run); } catch (Exception e) { LOGGER.error(e.getMessage(), e); addRunLog(run, e.getMessage(), RESUME_RUN_TASK); failRunAndTerminateNode(run, e); throw new IllegalArgumentException(REJOIN_COMMAND_DESCRIPTION, e); } }  PipelineRun commitContainer(PipelineRun run, DockerRegistry registry,
                                       String newImageName, boolean clearContainer, boolean stopPipeline); @Async("pauseRunExecutor") void pauseRun(PipelineRun run); @Async("pauseRunExecutor") void resumeRun(PipelineRun run, List<String> endpoints); static final String DELIMITER; static final int COMMAND_CANNOT_EXECUTE_CODE; }### Answer:
@Ignore("test will be fixed in a separate branch") @Test public void resumeRunRestorePausedStatusIfFail() { AwsRegion region = new AwsRegion(); region.setRegionCode("eu-central-1"); region.setId(1L); Mockito.when(regionManager.load(Mockito.any())).thenReturn(region); Mockito.when(cloudFacade.startInstance(Mockito.anyLong(), Mockito.anyString())) .thenReturn(CloudInstanceOperationResult.builder().status(Status.ERROR) .message(INSUFFICIENT_INSTANCE_CAPACITY).build()); PipelineRun run = createRun(); operationManager.resumeRun(run, Collections.emptyList()); Assert.assertEquals(run.getStatus(), TaskStatus.PAUSED); }