Search in sources :

Example 1 with KeywhizService

use of keywhiz.KeywhizService in project keywhiz by square.

the class ServiceContext method create.

public static ServiceContext create() {
    KeywhizService service = new KeywhizService();
    Bootstrap<KeywhizConfig> bootstrap = new Bootstrap<>(service);
    service.initialize(bootstrap);
    ObjectMapper objectMapper = bootstrap.getObjectMapper().copy();
    Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
    KeywhizConfig config = loadTestConfig(objectMapper, validator);
    Environment environment = new Environment(bootstrap.getApplication().getName(), objectMapper, validator, bootstrap.getMetricRegistry(), bootstrap.getClassLoader());
    return new ServiceContext(service, bootstrap, config, environment);
}
Also used : KeywhizService(keywhiz.KeywhizService) KeywhizConfig(keywhiz.KeywhizConfig) Bootstrap(io.dropwizard.setup.Bootstrap) Environment(io.dropwizard.setup.Environment) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Validator(javax.validation.Validator)

Example 2 with KeywhizService

use of keywhiz.KeywhizService in project keywhiz by square.

the class LdapLookupConfigTest method setup.

@Before
public void setup() {
    KeywhizService service = new KeywhizService();
    bootstrap = new Bootstrap<>(service);
    service.initialize(bootstrap);
}
Also used : KeywhizService(keywhiz.KeywhizService) Before(org.junit.Before)

Aggregations

KeywhizService (keywhiz.KeywhizService)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Bootstrap (io.dropwizard.setup.Bootstrap)1 Environment (io.dropwizard.setup.Environment)1 Validator (javax.validation.Validator)1 KeywhizConfig (keywhiz.KeywhizConfig)1 Before (org.junit.Before)1