Search in sources :

Example 1 with NestedBeaconException

use of org.molgenis.beacon.controller.model.exceptions.NestedBeaconException in project molgenis by molgenis.

the class BeaconQueryServiceTest method queryErrorTest.

@Test
public void queryErrorTest() {
    MolgenisDataException exception = new MolgenisDataException("Error test");
    when(dataService.findOneById(BeaconMetadata.BEACON, BEACON_ID, Beacon.class)).thenThrow(exception);
    BeaconAlleleRequest request = BeaconAlleleRequest.create("1", 100L, "A", "T");
    try {
        beaconQueryService.query("beacon", request);
    } catch (BeaconException e) {
        BeaconException beaconException = new NestedBeaconException(BEACON_ID, request);
        assertEquals(e.getMessage(), beaconException.getMessage());
    }
}
Also used : MolgenisDataException(org.molgenis.data.MolgenisDataException) BeaconAlleleRequest(org.molgenis.beacon.controller.model.BeaconAlleleRequest) NestedBeaconException(org.molgenis.beacon.controller.model.exceptions.NestedBeaconException) NestedBeaconException(org.molgenis.beacon.controller.model.exceptions.NestedBeaconException) BeaconException(org.molgenis.beacon.controller.model.exceptions.BeaconException) Test(org.testng.annotations.Test)

Aggregations

BeaconAlleleRequest (org.molgenis.beacon.controller.model.BeaconAlleleRequest)1 BeaconException (org.molgenis.beacon.controller.model.exceptions.BeaconException)1 NestedBeaconException (org.molgenis.beacon.controller.model.exceptions.NestedBeaconException)1 MolgenisDataException (org.molgenis.data.MolgenisDataException)1 Test (org.testng.annotations.Test)1