public class Initialization extends Object
ExtensionInjectorBuilder. Instead, simple tests can use
StartupInjectorBuilder directly, passing in any needed modules.
Some tests use modules that rely on the "startup injector" to
inject values into a module. In that case, tests should use two
builders: the StartupInjectorBuilder followed by
the CoreInjectorBuilder class to hold extra modules.
Look for references to CoreInjectorBuilder to find examples
of this pattern.
In both cases, the injector builders have options to add the full set of server modules. Tests should not load those modules. Instead, let the injector builders provide just the required set, and then explicitly list the (small subset) of modules needed by any given test.
The server initialization formerly done here is now done in
GuiceRunnable by way of
the ServerInjectorBuilder.
| Constructor and Description |
|---|
Initialization() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.inject.Injector |
makeInjectorWithModules(com.google.inject.Injector baseInjector,
Iterable<? extends com.google.inject.Module> modules)
Deprecated.
|
@Deprecated public static com.google.inject.Injector makeInjectorWithModules(com.google.inject.Injector baseInjector, Iterable<? extends com.google.inject.Module> modules)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.