Search in sources :

Example 1 with MagmaRuntimeException

use of org.obiba.magma.MagmaRuntimeException in project mica2 by obiba.

the class CollectedDatasetServiceTest method testDatasourceConnectionErrorIsIgnoredForDraft.

@Test
public void testDatasourceConnectionErrorIsIgnoredForDraft() {
    RestDatasource r = mock(RestDatasource.class);
    when(r.getValueTable(anyString())).thenThrow(new MagmaRuntimeException());
    when(opalService.getDatasource(anyString(), anyString())).thenReturn(r);
    when(individualStudyService.findDraft(anyString())).thenReturn(study);
    when(studyDatasetStateRepository.findOne(anyString())).thenReturn(state);
    collectedDatasetService.save(dataset);
}
Also used : RestDatasource(org.obiba.opal.rest.client.magma.RestDatasource) MagmaRuntimeException(org.obiba.magma.MagmaRuntimeException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MagmaRuntimeException (org.obiba.magma.MagmaRuntimeException)1 RestDatasource (org.obiba.opal.rest.client.magma.RestDatasource)1