@Test(expectedExceptions = IllegalArgumentException.class) public void testCreateChannelNullAccount() throws Exception { notificationService.createChannel(null, channel); }
public Channel createChannel(final Account account, final Channel channel) { notNull(account, "account"); notNull(channel, "channel"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Channel.URI, channel, Channel.class, account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create channel", e); } }
NotificationService extends AbstractService { public Channel createChannel(final Account account, final Channel channel) { notNull(account, "account"); notNull(channel, "channel"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Channel.URI, channel, Channel.class, account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create channel", e); } } }
NotificationService extends AbstractService { public Channel createChannel(final Account account, final Channel channel) { notNull(account, "account"); notNull(channel, "channel"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Channel.URI, channel, Channel.class, account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create channel", e); } } NotificationService(final RestTemplate restTemplate, final GoodDataSettings settings); }
NotificationService extends AbstractService { public Channel createChannel(final Account account, final Channel channel) { notNull(account, "account"); notNull(channel, "channel"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Channel.URI, channel, Channel.class, account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create channel", 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 Channel createChannel(final Account account, final Channel channel) { notNull(account, "account"); notNull(channel, "channel"); notEmpty(account.getId(), "account.id"); try { return restTemplate.postForObject(Channel.URI, channel, Channel.class, account.getId()); } catch (GoodDataRestException | RestClientException e) { throw new GoodDataException("Unable to create channel", 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);  }