diff --git a/core/src/test/java/org/synyx/hera/core/support/BeanListFactoryBeanUnitTest.java b/core/src/test/java/org/synyx/hera/core/support/BeanListFactoryBeanUnitTest.java index 7e3925c..2018cc3 100644 --- a/core/src/test/java/org/synyx/hera/core/support/BeanListFactoryBeanUnitTest.java +++ b/core/src/test/java/org/synyx/hera/core/support/BeanListFactoryBeanUnitTest.java @@ -60,6 +60,21 @@ public class BeanListFactoryBeanUnitTest { } + @Test + public void returnsEmptyListIfNoBeansFound() throws Exception { + + expect(context.getBeansOfType(Ordered.class)).andReturn( + new HashMap()); + replay(context); + + Object result = factory.getObject(); + assertTrue(result instanceof List); + + List members = (List) result; + assertTrue(members.isEmpty()); + } + + /** * Returns an {@link Ordered} with the given order. *