@Test public void removeTriggerFromNotification() throws Exception { TriggerObject triggerObj = ImmutableTriggerObject.builder().alertId(LONG_ID).id(LONG_ID).notificationIds(LIST_OF_LONG_ID).build(); Response<TriggerObject> response = Response.success(triggerObj); @SuppressWarnings("unchecked") Call<NotificationObject>responseCall = mock(Call.class); doReturn(response).when(responseCall).execute(); doReturn(request).when(responseCall).request(); doReturn(responseCall).when(svc).removeTriggerFromNotification(any(), anyLong(), anyLong(), anyLong()); argus.removeTriggerFromNotification(LONG_ID, Iterables.getOnlyElement(LIST_OF_LONG_ID), LONG_ID); verify(svc).removeTriggerFromNotification(AUTHORIZATION_HEADER, LONG_ID, Iterables.getOnlyElement(LIST_OF_LONG_ID), LONG_ID); }
public void removeTriggerFromNotification(long alertId, long notificationId, long triggerId) throws UnauthorizedException { Preconditions.checkNotNull(alertId, "Alert id should not be null"); Preconditions.checkNotNull(notificationId, "Notification id should not be null"); Preconditions.checkNotNull(triggerId, "Trigger id should not be null"); executeAndRetrieveBody(svc().removeTriggerFromNotification(authorizationHeader(), alertId, notificationId, triggerId), null); }
ArgusClient extends AbstractRemoteClient<ArgusService> { public void removeTriggerFromNotification(long alertId, long notificationId, long triggerId) throws UnauthorizedException { Preconditions.checkNotNull(alertId, "Alert id should not be null"); Preconditions.checkNotNull(notificationId, "Notification id should not be null"); Preconditions.checkNotNull(triggerId, "Trigger id should not be null"); executeAndRetrieveBody(svc().removeTriggerFromNotification(authorizationHeader(), alertId, notificationId, triggerId), null); } }
ArgusClient extends AbstractRemoteClient<ArgusService> { public void removeTriggerFromNotification(long alertId, long notificationId, long triggerId) throws UnauthorizedException { Preconditions.checkNotNull(alertId, "Alert id should not be null"); Preconditions.checkNotNull(notificationId, "Notification id should not be null"); Preconditions.checkNotNull(triggerId, "Trigger id should not be null"); executeAndRetrieveBody(svc().removeTriggerFromNotification(authorizationHeader(), alertId, notificationId, triggerId), null); } ArgusClient(EndpointConnector connector); }
ArgusClient extends AbstractRemoteClient<ArgusService> { public void removeTriggerFromNotification(long alertId, long notificationId, long triggerId) throws UnauthorizedException { Preconditions.checkNotNull(alertId, "Alert id should not be null"); Preconditions.checkNotNull(notificationId, "Notification id should not be null"); Preconditions.checkNotNull(triggerId, "Trigger id should not be null"); executeAndRetrieveBody(svc().removeTriggerFromNotification(authorizationHeader(), alertId, notificationId, triggerId), null); } ArgusClient(EndpointConnector connector); @Override boolean isAuthenticated(); List<MetricResponse> getMetrics(List<String> expressions); AlertObject createAlert(AlertObject alert); AlertObject updateAlert(AlertObject alert); AlertObject loadAlert(long id); List<AlertObject> loadAllAlerts(); List<AlertObject> loadAlertsByOwner(String ownerName); List<AlertObject> loadAlertsMetadataByOwner(String ownerName); void deleteAlert(long alertId); List<TriggerObject> loadTriggersForAlert(long alertId); List<TriggerObject> createTrigger(long alertId, TriggerObject trigger); TriggerObject updateTrigger(long alertId, TriggerObject trigger); void deleteTrigger(long alertId, long triggerId); NotificationObject getNotification(long alertId, long notificationId); List<NotificationObject> getNotificationsForAlert(long alertId); List<NotificationObject> createNotification(long alertId, NotificationObject notification); NotificationObject updateNotification(long alertId, long notificationId, NotificationObject notification); void deleteNotification(long alertId, long notificationId); TriggerObject attachTriggerToNotification(long alertId, long notificationId, long triggerId); void removeTriggerFromNotification(long alertId, long notificationId, long triggerId); List<DashboardObject> getAllDashboards(); DashboardObject getDashboardByName(String owner, String dashboardName); DashboardObject createDashboard(DashboardObject dashboard); DashboardObject updateDashboard(long dashboardId, DashboardObject dashboard); void deleteDashboard(long dashboardId); DashboardObject getDashboardById(long dashboardId); }
ArgusClient extends AbstractRemoteClient<ArgusService> { public void removeTriggerFromNotification(long alertId, long notificationId, long triggerId) throws UnauthorizedException { Preconditions.checkNotNull(alertId, "Alert id should not be null"); Preconditions.checkNotNull(notificationId, "Notification id should not be null"); Preconditions.checkNotNull(triggerId, "Trigger id should not be null"); executeAndRetrieveBody(svc().removeTriggerFromNotification(authorizationHeader(), alertId, notificationId, triggerId), null); } ArgusClient(EndpointConnector connector); @Override boolean isAuthenticated(); List<MetricResponse> getMetrics(List<String> expressions); AlertObject createAlert(AlertObject alert); AlertObject updateAlert(AlertObject alert); AlertObject loadAlert(long id); List<AlertObject> loadAllAlerts(); List<AlertObject> loadAlertsByOwner(String ownerName); List<AlertObject> loadAlertsMetadataByOwner(String ownerName); void deleteAlert(long alertId); List<TriggerObject> loadTriggersForAlert(long alertId); List<TriggerObject> createTrigger(long alertId, TriggerObject trigger); TriggerObject updateTrigger(long alertId, TriggerObject trigger); void deleteTrigger(long alertId, long triggerId); NotificationObject getNotification(long alertId, long notificationId); List<NotificationObject> getNotificationsForAlert(long alertId); List<NotificationObject> createNotification(long alertId, NotificationObject notification); NotificationObject updateNotification(long alertId, long notificationId, NotificationObject notification); void deleteNotification(long alertId, long notificationId); TriggerObject attachTriggerToNotification(long alertId, long notificationId, long triggerId); void removeTriggerFromNotification(long alertId, long notificationId, long triggerId); List<DashboardObject> getAllDashboards(); DashboardObject getDashboardByName(String owner, String dashboardName); DashboardObject createDashboard(DashboardObject dashboard); DashboardObject updateDashboard(long dashboardId, DashboardObject dashboard); void deleteDashboard(long dashboardId); DashboardObject getDashboardById(long dashboardId);  }