use of com.palantir.atlasdb.jackson.AtlasJacksonModule in project atlasdb by palantir.
the class TransactionRemotingTest method setupHacks.
@SuppressWarnings("unchecked")
@Before
public void setupHacks() throws Exception {
Field field = dropwizard.getClass().getDeclaredField("testSupport");
field.setAccessible(true);
DropwizardTestSupport<Configuration> testSupport = (DropwizardTestSupport<Configuration>) field.get(dropwizard);
ObjectMapper mapper = testSupport.getEnvironment().getObjectMapper();
mapper.registerModule(new AtlasJacksonModule(cache).createModule());
mapper.registerModule(new GuavaModule());
}
use of com.palantir.atlasdb.jackson.AtlasJacksonModule in project atlasdb by palantir.
the class AtlasDbServiceServer method run.
@Override
public void run(AtlasDbServiceServerConfiguration config, final Environment environment) throws Exception {
AtlasDbMetrics.setMetricRegistries(environment.metrics(), DefaultTaggedMetricRegistry.getDefault());
SerializableTransactionManager tm = TransactionManagers.builder().config(config.getConfig()).userAgent("AtlasDbServiceServer").globalMetricsRegistry(environment.metrics()).globalTaggedMetricRegistry(DefaultTaggedMetricRegistry.getDefault()).registrar(environment.jersey()::register).build().serializable();
TableMetadataCache cache = new TableMetadataCache(tm.getKeyValueService());
environment.jersey().register(new AtlasDbServiceImpl(tm.getKeyValueService(), tm, cache));
environment.getObjectMapper().registerModule(new AtlasJacksonModule(cache).createModule());
}
Aggregations