Package org.apache.camel.test.cdi
Annotation Type Beans
-
@Documented @Inherited @Retention(RUNTIME) @Target(TYPE) public @interface Beans
Annotation to be used to customise the deployment configured by theCamelCdiRunner.- See Also:
CamelCdiRunner
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Class<?>[]alternativesReturns the list of alternatives to be selected in the application.Class<?>[]classesReturns the list of classes to be added as beans in the application.Class<?>[]packagesReturns 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:
It can be replaced in your test by declaring the following alternative bean:@Named("foo") public class FooBean { }
And adding the@Alternative @Named("foo") public class AlternativeBean { }@Beansannotation 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:
- {}
-
-