@Test public void canSerialiseInfoEventWithoutValue() { Event infoEvent = ImmutableInfoEvent.builder() .function("foo") .process(SOME_PROCESS) .time(SOME_TIME) .build(); Map<Keyword, Object> expected = ImmutableMap.of( Keyword.intern("type"), "info", Keyword.intern("f"), "foo", Keyword.intern("process"), SOME_PROCESS, Keyword.intern("time"), SOME_TIME); assertThat(Event.toKeywordMap(infoEvent)).isEqualTo(expected); } }
@Test public void canSerialiseInfoEventWithValue() { Event infoEvent = ImmutableInfoEvent.builder() .function("foo") .process(SOME_PROCESS) .time(SOME_TIME) .value("bar") .build(); Map<Keyword, Object> expected = ImmutableMap.of( Keyword.intern("type"), "info", Keyword.intern("f"), "foo", Keyword.intern("process"), SOME_PROCESS, Keyword.intern("time"), SOME_TIME, Keyword.intern("value"), "bar"); assertThat(Event.toKeywordMap(infoEvent)).isEqualTo(expected); }
public static InfoEvent createInfoEvent(long time, int process, String requestType) { return ImmutableInfoEvent.builder() .time(time) .process(process) .function(requestType) .build(); }
public static InfoEvent createInfoEvent(long time, int process, String requestType, String value) { return ImmutableInfoEvent.builder() .time(time) .process(process) .function(requestType) .value(value) .build(); } }