Guiced EE has been built to allow unit and integration testing at any level, without any impact to existing
module-info
files,
It allows you to modify the boot sequence dynamically to include or exclude any modules of your choice
All* of these should be called before GuiceContext.inject()
You can modify the Classpath Scanner configuration for instance by accessing the configuration
GuiceContext.instance().getConfig() .setPathScanning(true) .setExcludeModulesAndJars(true) .setExcludePackages(true) .setExcludeParentModules(true);All loading modules are made available through the
GuiceContext.instance()
accessor.
By using the load methods, you can alter the execution sequence in any way.
Lets say you want to add a path exclusion in your test to see what happens when the pom.properties/xml file isn't present
GuiceContext.instance().loadPathRejectScanners().add( () -> { Setoutput = new HashSet<>(); output.add("/META-INF/services/maven"); return output; } );
You can manage what modules get loaded, in your tests to swap them out say, for their test counterpart,
Each Guiced EE Module gives you tools to manage unit testing them, for instance servlets, persistence, and web sockets.
GuiceContext.instance().loadIGuiceModules().add(new TestJTADBPrivateModule());