Package io.github.cdiunit
Annotation Type AdditionalClasses
@AdditionalClasses
adds classes to the CDI environment that are not discovered automatically.
@RunWith(CdiRunner.class) @AdditionalClasses(WarpDrive.class) //WarpDrive is not discoverable from the unit test so explicitly make it available. class TestStarship { @Inject Starship starship; //Starship has an engine. @Test void testStart() { starship.start(); // Going to warp! } }
- Author:
- Bryn Cooke
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements