Search in sources :

Example 1 with SamInternalServerErrorException

use of bio.terra.common.sam.exception.SamInternalServerErrorException in project terra-workspace-manager by DataBiosphere.

the class WorkspaceServiceTest method testHandlesSamError.

@Test
void testHandlesSamError() throws Exception {
    String apiErrorMsg = "test";
    ErrorReportException testex = new SamInternalServerErrorException(apiErrorMsg);
    doThrow(testex).when(mockSamService).createWorkspaceWithDefaults(any(), any());
    ErrorReportException exception = assertThrows(SamInternalServerErrorException.class, () -> workspaceService.createWorkspace(defaultRequestBuilder(UUID.randomUUID()).build(), USER_REQUEST));
    assertEquals(apiErrorMsg, exception.getMessage());
}
Also used : ErrorReportException(bio.terra.common.exception.ErrorReportException) SamInternalServerErrorException(bio.terra.common.sam.exception.SamInternalServerErrorException) Test(org.junit.jupiter.api.Test) BaseConnectedTest(bio.terra.workspace.common.BaseConnectedTest)

Aggregations

ErrorReportException (bio.terra.common.exception.ErrorReportException)1 SamInternalServerErrorException (bio.terra.common.sam.exception.SamInternalServerErrorException)1 BaseConnectedTest (bio.terra.workspace.common.BaseConnectedTest)1 Test (org.junit.jupiter.api.Test)1