Annotation Type Beans

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?>[] alternatives
      Returns the list of alternatives to be selected in the application.
      Class<?>[] classes
      Returns the list of classes to be added as beans in the application.
      Class<?>[] packages
      Returns the list of classes whose packages are to be added for beans discovery.
    • Element Detail

      • alternatives

        Class<?>[] alternatives
        Returns the list of alternatives to be selected in the application.

        Note that the declared alternatives are globally selected for the entire application. For example, if you have the following named bean in your application:

         
         @Named("foo")
         public class FooBean {
        
         }
         
         
        It can be replaced in your test by declaring the following alternative bean:
         
         @Alternative
         @Named("foo")
         public class AlternativeBean {
        
         }
         
         
        And adding the @Beans annotation to you test class to activate it:
         
         @RunWith(CamelCdiRunner.class)
         @Beans(alternatives = AlternativeBean.class)
         public class TestWithAlternative {
        
         }
         
         
        See Also:
        Alternative
        Default:
        {}
      • classes

        Class<?>[] classes
        Returns the list of classes to be added as beans in the application. That can be used to add classes to the deployment for test purpose in addition to the test class which is automatically added as bean.
        Default:
        {}
      • packages

        Class<?>[] packages
        Returns the list of classes whose packages are to be added for beans discovery. That can be used to add packages to the deployment for test purpose in addition to the test class which is automatically added as bean.
        Default:
        {}