use of org.komamitsu.fluency.FluencyBuilder in project fluency by komamitsu.
the class FluencyTest method testBufferWithJacksonModule.
@ParameterizedTest
@MethodSource("sslFlagsProvider")
void testBufferWithJacksonModule() throws IOException {
AtomicBoolean serialized = new AtomicBoolean();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Foo.class, new FooSerializer(serialized));
FluentdRecordFormatter.Config recordFormatterConfig = new FluentdRecordFormatter.Config();
recordFormatterConfig.setJacksonModules(Collections.singletonList(simpleModule));
Fluency fluency = new FluencyBuilder().buildFromIngester(new FluentdRecordFormatter(recordFormatterConfig), ingester);
Map<String, Object> event = new HashMap<>();
Foo foo = new Foo();
foo.s = "Hello";
event.put("foo", foo);
fluency.emit("tag", event);
assertThat(serialized.get(), is(true));
}
Aggregations