use of org.molgenis.beacon.controller.model.exceptions.BeaconException 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());
}
}
Aggregations