AlertService extends EndpointService { public Alert getAlert(BigInteger alertId) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/" + alertId.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(response.getResult(), Alert.class); } AlertService(ArgusHttpClient client); List<Alert> getAlerts(); List<Alert> getAlerts(boolean includeSharedAlerts); List<Alert> getAlertsMeta(boolean includeSharedAlerts); Alert getAlert(BigInteger alertId); List<Notification> getNotifications(BigInteger alertId); List<Trigger> getTriggers(BigInteger alertId); Notification getNotification(BigInteger alertId, BigInteger notificationId); List<Trigger> getTriggersForNotification(BigInteger alertId, BigInteger notificationId); Trigger getTrigger(BigInteger alertId, BigInteger triggerId); Trigger getTriggerIfAssigned(BigInteger alertId, BigInteger notificationId, BigInteger triggerId); Alert createAlert(Alert alert); Alert updateAlert(BigInteger alertId, Alert alert); Alert cloneAlert(BigInteger alertId, String newAlertName); Notification updateNotification(BigInteger alertId, BigInteger notificationId, Notification notification); Trigger updateTrigger(BigInteger alertId, BigInteger triggerId, Trigger trigger); List<Notification> createNotification(BigInteger alertId, Notification notification); List<Trigger> createTrigger(BigInteger alertId, Trigger trigger); Trigger linkTrigger(BigInteger alertId, BigInteger notificationId, BigInteger triggerId); void deleteAlert(BigInteger alertId); void deleteNotifications(BigInteger alertId); void deleteNotification(BigInteger alertId, BigInteger notificationId); void deleteTriggers(BigInteger alertId); void deleteTrigger(BigInteger alertId, BigInteger triggerId); void unlinkTriggers(BigInteger alertId, BigInteger notificationId); void unlinkTrigger(BigInteger alertId, BigInteger notificationId, BigInteger triggerId);  }
@Test public void testGetAlert() throws IOException, TokenExpiredException { try(ArgusService argusService = new ArgusService(getMockedClient("/AlertServiceTest.json"))) { AlertService alertService = argusService.getAlertService(); Alert result = alertService.getAlert(BigInteger.ONE); Alert expected = _constructPersistedAlert(); assertEquals(expected, result); } }