NotificationClient implements Closeable { public void delete(final String username, final Collection<String> ids) { Objects.requireNonNull(ids, "ids == null"); Preconditions.checkArgument(!ids.isEmpty(), "ids cannot be empty"); final URI uri = UriBuilder.fromUri(getTarget(username)).queryParam("ids", String.join(",", ids)).build(); LOGGER.debug("DELETE {}", uri); try (Timer.Context context = deleteTimer.time()) { client.target(uri).request().delete(); } catch (Exception e) { LOGGER.warn("Unable to delete notifications for {}", username, e); } } NotificationClient(final MetricRegistry registry, final Client client, final URI uri); Optional<SortedSet<Notification>> fetch(final String username); Optional<Notification> store(final String username, final Notification notification); void delete(final String username, final Collection<String> ids); void delete(final String username); boolean ping(); String version(); @Override void close();  }
@Test public void testDeleteAll() throws Exception { client.delete("test"); }
@Test(expected = IllegalArgumentException.class) public void testDeleteAllEmptyUsername() throws Exception { client.delete(""); }
@Test public void testDelete() throws Exception { client.delete("test", ImmutableList.of("1", "2")); }
@Test(expected = IllegalArgumentException.class) public void testDeleteEmptyUsername() throws Exception { client.delete("", ImmutableList.of("1")); }
@Test(expected = IllegalArgumentException.class) public void testDeleteEmptyIds() throws Exception { client.delete("test", ImmutableList.<String>of()); }