assertEquals("Unexpected number of alerts on the resource.", 1, alerts.size());
}
// we can add a lot more here, but this mainly exists to test some criteria stuff not obviously tested elsewhere
public void testFindByResourceCriteria() {
ResourceCriteria c = new ResourceCriteria();
List<Resource> result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertNotNull(result);
assertEquals(1, result.size());
c.addFilterPluginName("TES");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(1, result.size());
c.setStrict(true);
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
c.setStrict(false);
c.setCaseSensitive(true);
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
c.setCaseSensitive(false);
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(1, result.size());
c.setStrictFilters("foo");
c.setCaseSensitiveFilters("foo");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(1, result.size());
c.setStrictFilters("pluginName", "foo");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
c.setStrictFilters(null);
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(1, result.size());
c.setCaseSensitiveFilters("pluginName", "foo");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
c.setCaseSensitiveFilters("pluginName", "foo");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
c.setStrictFilters("pluginName", "foo");
c.setCaseSensitiveFilters("pluginName", "foo");
c.addFilterPluginName("test");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(1, result.size());
c.addFilterPluginName("TEST");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
c.addFilterPluginName("testy");
result = resourceManager.findResourcesByCriteria(getOverlord(), c);
assertEquals(0, result.size());
}