public class ConfigOverride extends Object
DropwizardAppExtension.
Given a configuration file containing
---
server:
applicationConnectors:
- type: http
port: 8000
adminConnectors:
- type: http
port: 8001
logging:
loggers:
com.example.foo: INFO
ConfigOverride.config("debug", "true") will add a top level
field named "debug" mapped to the string "true".ConfigOverride.config("server.applicationConnectors[0].type",
"https") will change the sole application connector to have type
"https" instead of type "http".
ConfigOverride.config("logging.loggers.com\\.example\\.bar",
"DEBUG") will add a logger with the name "com.example.bar" configured
for debug logging.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PREFIX |
| Modifier and Type | Method and Description |
|---|---|
void |
addToSystemProperties() |
static ConfigOverride |
config(String key,
String value) |
static ConfigOverride |
config(String propertyPrefix,
String key,
String value) |
static ConfigOverride |
config(String propertyPrefix,
String key,
Supplier<String> value) |
static ConfigOverride |
config(String key,
Supplier<String> value) |
void |
removeFromSystemProperties() |
public static final String DEFAULT_PREFIX
public static ConfigOverride config(String key, String value)
public static ConfigOverride config(String propertyPrefix, String key, String value)
public static ConfigOverride config(String key, Supplier<String> value)
public static ConfigOverride config(String propertyPrefix, String key, Supplier<String> value)
public void addToSystemProperties()
public void removeFromSystemProperties()
Copyright © 2019. All rights reserved.