@Retention(value=RUNTIME) @Target(value=TYPE) public @interface AdditionalPackages
@AdditionalPackages adds all the classes in a particular package entry to the CDI environment that are not discovered
automatically.
@RunWith(CdiRunner.class)
@AdditionalPackages(Enterprise.class) // WarpDrive is in the package that contains Enterprise.
class TestStarship {
@Inject
Starship starship; // Starship has an engine in the same package as Enterprise.
@Test
void testStart() {
starship.start(); // Going to warp!
}
}
public abstract Class<?>[] value
Copyright © 2017–2018. All rights reserved.