use of bio.terra.workspace.service.workspace.flight.CheckSamWorkspaceAuthzStep in project terra-workspace-manager by DataBiosphere.
the class WorkspaceServiceTest method createRawlsWorkspaceDoSteps.
@Test
void createRawlsWorkspaceDoSteps() throws InterruptedException {
Workspace request = defaultRequestBuilder(UUID.randomUUID()).workspaceStage(WorkspaceStage.RAWLS_WORKSPACE).build();
// Ensure the auth check in CheckSamWorkspaceAuthzStep always succeeds.
doReturn(true).when(mockSamService).isAuthorized(any(), any(), any(), any());
Map<String, StepStatus> retrySteps = new HashMap<>();
retrySteps.put(CheckSamWorkspaceAuthzStep.class.getName(), StepStatus.STEP_RESULT_FAILURE_RETRY);
retrySteps.put(CreateWorkspaceStep.class.getName(), StepStatus.STEP_RESULT_FAILURE_RETRY);
FlightDebugInfo debugInfo = FlightDebugInfo.newBuilder().doStepFailures(retrySteps).build();
jobService.setFlightDebugInfoForTest(debugInfo);
UUID createdId = workspaceService.createWorkspace(request, USER_REQUEST);
assertEquals(createdId, request.getWorkspaceId());
}
Aggregations