### Question:
VActionFullHandler implements ApplicationHandler { public void delete(SubscriptionData subscription) { final FeedData feed = getFeed(subscription); if ((feed != null) && feed.isValid()) { final FeedSubscriptionData feedSubscription = FeedSubscriptionData.findByObjectAndFeed(subscription.getObject(), feed); if ((feedSubscription != null) && feedSubscription.isValid()) { feedSubscription.delete(); } if (feed.shouldBeDeleted()) { feed.delete(); } } deleteFile(subscription); subscription.delete(); } VActionFullHandler(ApplicationData application); SubscriptionData create(VObjectData object, Map<String, Object> settings); void update(SubscriptionData subscription, Map<String, Object> settings); void checkSettings(VObjectData object, Map<String, Object> settings); void delete(SubscriptionData subscription); Map<String, Object> getUISettings(SubscriptionData subscription, APICaller inApiCaller); boolean hasAlreadySubscribed(FeedData theFeed, VObjectData theObject); static SubscriptionData createOrUpdateSubscription(SubscriptionData subscription, VObjectData object, int nbNews, String timeW, String timeWe, String frequency, String alertName, String url, Lang lang, boolean isPodcast); String getSubscriptionInformation(SubscriptionData subscription); static final String URL; static final String LANG; static final String LABEL; static final String FILE; static final String NB_NEWS; static final String ACTION; static final String FEED; }### Answer:
@Test public void deleteTest() throws InvalidSettingException, MissingSettingException { final VObjectData object = VObjectData.getData(getKowalskyObject()); final Feed theFeed = new FeedMock("http: final Map<String, Object> theParams = new HashMap<String, Object>(); theParams.put(VActionFullHandler.URL, "http: theParams.put(VActionFullHandler.LABEL, "label"); theParams.put(VActionFullHandler.LANG, "fr-FR"); theParams.put(VActionFullHandler.NB_NEWS, "4"); Assert.assertNotNull(Factories.FEED.findByUrlAndType("http: final SubscriptionData theSub = ApplicationHandlerManager.createSubscription(getRssApplication(), object, theParams); Assert.assertTrue(theSub.isValid()); FeedSubscriptionData sub = FeedSubscriptionData.findByObjectAndFeed(object, FeedData.getData(theFeed)); Assert.assertTrue(sub.isValid()); final Map<String, Object> settings = theSub.getSettings(); Assert.assertEquals(5, settings.size()); Assert.assertEquals("4", settings.get(VActionFullHandler.NB_NEWS)); Assert.assertEquals("fr-FR", settings.get(VActionFullHandler.LANG)); Assert.assertEquals("label", settings.get(VActionFullHandler.LABEL)); Assert.assertEquals(theFeed.getId().toString(), settings.get(VActionFullHandler.FEED)); final int fileId = Integer.parseInt(settings.get(VActionFullHandler.FILE).toString()); final Files file = Factories.FILES.find(fileId); Assert.assertNotNull(file); ApplicationHandlerManager.deleteSubscription(theSub); Assert.assertNull(Factories.FEED.findByUrlAndType("http: sub = FeedSubscriptionData.findByObjectAndFeed(object, FeedData.getData(theFeed)); Assert.assertNull(sub); }