* added test case to assert an empty list if no beans are found at all

git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@7554 5a64d73e-33d6-4ccc-9058-23f8668ecac9
This commit is contained in:
Oliver Gierke
2009-10-23 07:30:21 +00:00
parent 7b7442f159
commit 032849a858

View File

@@ -60,6 +60,21 @@ public class BeanListFactoryBeanUnitTest {
}
@Test
public void returnsEmptyListIfNoBeansFound() throws Exception {
expect(context.getBeansOfType(Ordered.class)).andReturn(
new HashMap<String, Ordered>());
replay(context);
Object result = factory.getObject();
assertTrue(result instanceof List<?>);
List<Ordered> members = (List) result;
assertTrue(members.isEmpty());
}
/**
* Returns an {@link Ordered} with the given order.
*