@Test(expectedExceptions = IllegalArgumentException.class) public void testCreateSubscriptionNullSubscription() throws Exception { notificationService.createSubscription(project, account, null); }
public Subscription createSubscription(final Project project, final Account account, final Subscription subscription) { notNull(project, "project"); notNull(account, "account"); notNull(subscription, "subscription"); notEmpty(project.getId(), "project.id"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Subscription.URI, subscription, Subscription.class, project.getId(), account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create subscription", e); } }
NotificationService extends AbstractService { public Subscription createSubscription(final Project project, final Account account, final Subscription subscription) { notNull(project, "project"); notNull(account, "account"); notNull(subscription, "subscription"); notEmpty(project.getId(), "project.id"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Subscription.URI, subscription, Subscription.class, project.getId(), account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create subscription", e); } } }
NotificationService extends AbstractService { public Subscription createSubscription(final Project project, final Account account, final Subscription subscription) { notNull(project, "project"); notNull(account, "account"); notNull(subscription, "subscription"); notEmpty(project.getId(), "project.id"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Subscription.URI, subscription, Subscription.class, project.getId(), account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create subscription", e); } } NotificationService(final RestTemplate restTemplate, final GoodDataSettings settings); }
NotificationService extends AbstractService { public Subscription createSubscription(final Project project, final Account account, final Subscription subscription) { notNull(project, "project"); notNull(account, "account"); notNull(subscription, "subscription"); notEmpty(project.getId(), "project.id"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Subscription.URI, subscription, Subscription.class, project.getId(), account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create subscription", e); } } NotificationService(final RestTemplate restTemplate, final GoodDataSettings settings); void triggerEvent(final Project project, final ProjectEvent event); Channel createChannel(final Account account, final Channel channel); void removeChannel(final Channel channel); Subscription createSubscription(final Project project, final Account account, final Subscription subscription); void removeSubscription(final Subscription subscription); }
NotificationService extends AbstractService { public Subscription createSubscription(final Project project, final Account account, final Subscription subscription) { notNull(project, "project"); notNull(account, "account"); notNull(subscription, "subscription"); notEmpty(project.getId(), "project.id"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Subscription.URI, subscription, Subscription.class, project.getId(), account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create subscription", e); } } NotificationService(final RestTemplate restTemplate, final GoodDataSettings settings); void triggerEvent(final Project project, final ProjectEvent event); Channel createChannel(final Account account, final Channel channel); void removeChannel(final Channel channel); Subscription createSubscription(final Project project, final Account account, final Subscription subscription); void removeSubscription(final Subscription subscription);  }