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());
}
Aggregations