SubscriptionsRepository { public void removeSubscription(String subscriptionId) throws SubscriptionPersistenceException { try { jdbcTemplate.update("delete from t_subscriptions where id=?", subscriptionId); } catch (DataAccessException e) { throw new SubscriptionPersistenceException(e); } }  void saveSubscription(Subscription subscription); void updateSubscription(Subscription subscription); Map<String, Subscription> getAllSubscriptions(); void removeSubscription(String subscriptionId);  }
@Test public void removeSubscriptionTest() throws URISyntaxException, SubscriptionPersistenceException { SubscribeContext subscribeContext = createSubscribeContextTemperature(); Subscription subscription = new Subscription("12345", Instant.now().plus(1, ChronoUnit.DAYS), subscribeContext); subscriptionsRepository.saveSubscription(subscription); Assert.assertEquals(1, subscriptionsRepository.getAllSubscriptions().size()); subscriptionsRepository.removeSubscription("12345"); Assert.assertEquals(0, subscriptionsRepository.getAllSubscriptions().size()); }