use of io.dropwizard.configuration.JsonConfigurationFactory in project liftwizard by motlin.
the class ExecutorServiceFactoryTest method invalidExecutorServiceFactory.
@Test
public void invalidExecutorServiceFactory() throws Exception {
URL resource = Resources.getResource("invalid-executor-service-config-test.json5");
File json = new File(resource.toURI());
JsonConfigurationFactory<ExecutorServiceFactory> factory = new JsonConfigurationFactory<>(ExecutorServiceFactory.class, this.validator, this.objectMapper, "dw");
try {
ExecutorServiceFactory executorServiceFactory = factory.build(json);
Assert.fail();
} catch (ConfigurationValidationException e) {
String message = e.getMessage();
assertThat(message, containsString("maxThreads < minThreads"));
}
}
use of io.dropwizard.configuration.JsonConfigurationFactory in project liftwizard by motlin.
the class ExecutorServiceFactoryTest method executorServiceFactory.
@Test
public void executorServiceFactory() throws Exception {
URL resource = Resources.getResource("executor-service-config-test.json5");
File json = new File(resource.toURI());
JsonConfigurationFactory<ExecutorServiceFactory> factory = new JsonConfigurationFactory<>(ExecutorServiceFactory.class, this.validator, this.objectMapper, "dw");
ExecutorServiceFactory executorServiceFactory = factory.build(json);
}
use of io.dropwizard.configuration.JsonConfigurationFactory in project liftwizard by motlin.
the class ExecutorServiceFactoryTest method scheduledExecutorServiceFactory.
@Test
public void scheduledExecutorServiceFactory() throws Exception {
URL resource = Resources.getResource("executor-service-config-test.json5");
File json = new File(resource.toURI());
JsonConfigurationFactory<ScheduledExecutorServiceFactory> factory = new JsonConfigurationFactory<>(ScheduledExecutorServiceFactory.class, this.validator, this.objectMapper, "dw");
ScheduledExecutorServiceFactory executorServiceFactory = factory.build(json);
}
Aggregations