Configurer<Config>
@AutoService(Configurer.class) public class ConfigConfigurer extends Object implements Configurer<Config>
Config
annotation.Modifier | Constructor | Description |
---|---|---|
protected |
ConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader) |
|
|
ConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader,
GlobalConfigProvider defaultConfigProvider) |
Modifier and Type | Method | Description |
---|---|---|
Config |
defaultConfig() |
Returns the default configuration for tests that do not specify a configuration of this type.
|
static Config |
get(ConfigurationStrategy.Configuration testConfig) |
|
Class<Config> |
getConfigClass() |
Retrieve the class type for this Configurer
|
Config |
getConfigFor(Class<?> testClass) |
Returns the configuration for the given class.
|
Config |
getConfigFor(Method method) |
Returns the configuration for the given method.
|
Config |
getConfigFor(String packageName) |
Returns the configuration for a given package.
|
Config |
merge(Config parentConfig,
Config childConfig) |
Merges two configurations.
|
protected ConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader)
public ConfigConfigurer(PackagePropertiesLoader packagePropertiesLoader, GlobalConfigProvider defaultConfigProvider)
public static Config get(ConfigurationStrategy.Configuration testConfig)
public Class<Config> getConfigClass()
Configurer
getConfigClass
in interface Configurer<Config>
@Nonnull public Config defaultConfig()
Configurer
defaultConfig
in interface Configurer<Config>
public Config getConfigFor(@Nonnull String packageName)
Configurer
This method will be called once for package in the hierarchy leading to the test class being
configured. For example, for com.example.FooTest
, this method will be called three
times with "com.example"
, "@com"
, and ""
(representing the top level
package).
getConfigFor
in interface Configurer<Config>
packageName
- the name of the package, or the empty string representing the top level
unnamed packagepublic Config getConfigFor(@Nonnull Class<?> testClass)
Configurer
This method will be called for each class in the test's class inheritance hierarchy.
getConfigFor
in interface Configurer<Config>
public Config getConfigFor(@Nonnull Method method)
Configurer
getConfigFor
in interface Configurer<Config>
@Nonnull public Config merge(@Nonnull Config parentConfig, @Nonnull Config childConfig)
Configurer
Configurer.getConfigFor(java.lang.String)
returns a non-null configuration object.merge
in interface Configurer<Config>
parentConfig
- a less specific configuration objectchildConfig
- a more specific configuration object