/** * @param m a module to add to the test runtime. * @return this instance of test runtime builder. */ public T module(Module m) { bootique.module(m); return (T) this; }
/** * Adds a Module generated by the provider. Provider may optionally specify * that the Module overrides services in some other Module. * * @param moduleProvider a provider of Module and override spec. * @return this instance of test runtime builder. */ public T module(BQModuleProvider moduleProvider) { bootique.module(moduleProvider); return (T) this; }
/** * @param moduleType custom Module class to add to Bootique DI runtime. * @return this instance of test runtime builder. * @see #autoLoadModules() */ public T module(Class<? extends Module> moduleType) { bootique.module(moduleType); return (T) this; }
/** * Adds an array of Module types to the Bootique DI runtime. Each type will * be instantiated by Bootique and added to the Guice DI container. * * @param moduleTypes custom Module classes to add to Bootique DI runtime. * @return this Bootique instance * @see #autoLoadModules() * @since 0.8 */ @SafeVarargs public final Bootique modules(Class<? extends Module>... moduleTypes) { for (Class<? extends Module> c : moduleTypes) { module(c); } return this; }
protected BQTestRuntimeBuilder(String[] args) { //exclude system variables and properties by setting the properties final HashMap<String, String> properties = new HashMap<>(); properties.put(EXCLUDE_SYSTEM_PROPERTIES, "true"); properties.put(EXCLUDE_SYSTEM_VARIABLES, "true"); this.properties = properties; this.bootique = Bootique.app(args).module(createPropertiesProvider()); }
/** * Adds an array of Module types to the Bootique DI runtime. Each type will * be instantiated by Bootique and added to the Guice DI container. * * @param moduleTypes custom Module classes to add to Bootique DI runtime. * @return this Bootique instance * @see #autoLoadModules() * @since 0.8 */ @SafeVarargs public final Bootique modules(Class<? extends Module>... moduleTypes) { Arrays.asList(moduleTypes).forEach(m -> module(m)); return this; }