@Test
public void testOnRemove() throws IvoryException, JAXBException {

	Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
			FeedGroupMapTest.class
					.getResourceAsStream("/config/feed/feed-0.1.xml"));
	feed1.setName("f1");
	store.publish(EntityType.CLUSTER, cluster);
	feed1.setGroups("group7,group8,group9");
	Location location = new Location();
	location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
       location.setType(LocationType.DATA);
       feed1.setLocations(new Locations());
       feed1.getLocations().getLocations().add(location);
	store.publish(EntityType.FEED, feed1);
	Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
			FeedGroupMapTest.class
					.getResourceAsStream("/config/feed/feed-0.1.xml"));
	feed2.setName("f2");
	feed2.setGroups("group7,group8,group10");
	location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/${MONTH}/${DAY}/ad2");
       location.setType(LocationType.DATA);
       feed2.setLocations(new Locations());
       feed2.getLocations().getLocations().add(location);
	store.publish(EntityType.FEED, feed2);
	Map<String, FeedGroup> groupMapping = FeedGroupMap.get()
			.getGroupsMapping();
	store.remove(EntityType.FEED, "f2");
	FeedGroup group = groupMapping.get("group7");
	Assert.assertEquals(group.getName(), "group7");
	Assert.assertEquals(group.getFeeds().size(), 1);
	group = groupMapping.get("group8");
	Assert.assertEquals(group.getName(), "group8");
	Assert.assertEquals(group.getFeeds().size(), 1);
	group = groupMapping.get("group10");
	Assert.assertEquals(null, group);
	store.remove(EntityType.FEED, "f1");
	group = groupMapping.get("group7");
	Assert.assertEquals(null, group);
	group = groupMapping.get("group8");
	Assert.assertEquals(null, group);
	group = groupMapping.get("group9");
	Assert.assertEquals(null, group);
}