@Test public void removeSubscription() throws Exception { final Subscription newSubscription = server.subscribe(); final Optional<Subscription> subscription = server.subscriptionById(newSubscription.id()); assertThat(subscription.isPresent(), equalTo(true)); assertThat(subscription.get().id(), equalTo(newSubscription.id())); server.removeSubscription(subscription.get().id()); assertThat(server.subscriptionById(newSubscription.id()).isPresent(), is(false)); }
@Override public List<PushMessage> removeSubscription(final String id) { return store.removeSubscription(id); }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> removeSubscription(final String id) { return store.removeSubscription(id); } }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> removeSubscription(final String id) { return store.removeSubscription(id); } DefaultWebPushServer(final DataStore store, final WebPushServerConfig config, final byte[] privateKey); }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> removeSubscription(final String id) { return store.removeSubscription(id); } DefaultWebPushServer(final DataStore store, final WebPushServerConfig config, final byte[] privateKey); @Override Subscription subscribe(); @Override Optional<Subscription> subscriptionById(final String id); @Override Optional<Subscription> subscriptionByToken(final String subscriptionToken); @Override Optional<Subscription> subscriptionByPushToken(final String pushToken); @Override Optional<Subscription> subscriptionByReceiptToken(final String receiptToken); @Override List<PushMessage> removeSubscription(final String id); @Override void saveMessage(final PushMessage msg); @Override List<PushMessage> waitingDeliveryMessages(final String subId); @Override void saveSentMessage(final PushMessage msg); @Override Optional<PushMessage> sentMessage(final String pushMsgResource); @Override WebPushServerConfig config(); static byte[] generateAndStorePrivateKey(final DataStore store, final WebPushServerConfig config); @Override String generateEndpointToken(final String value); @Override String generateEndpointToken(final String firstId, final String secondId); }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> removeSubscription(final String id) { return store.removeSubscription(id); } DefaultWebPushServer(final DataStore store, final WebPushServerConfig config, final byte[] privateKey); @Override Subscription subscribe(); @Override Optional<Subscription> subscriptionById(final String id); @Override Optional<Subscription> subscriptionByToken(final String subscriptionToken); @Override Optional<Subscription> subscriptionByPushToken(final String pushToken); @Override Optional<Subscription> subscriptionByReceiptToken(final String receiptToken); @Override List<PushMessage> removeSubscription(final String id); @Override void saveMessage(final PushMessage msg); @Override List<PushMessage> waitingDeliveryMessages(final String subId); @Override void saveSentMessage(final PushMessage msg); @Override Optional<PushMessage> sentMessage(final String pushMsgResource); @Override WebPushServerConfig config(); static byte[] generateAndStorePrivateKey(final DataStore store, final WebPushServerConfig config); @Override String generateEndpointToken(final String value); @Override String generateEndpointToken(final String firstId, final String secondId);  }