use of org.graylog2.gelfclient.transport.GelfTransport in project graylog2-server by Graylog2.
the class GelfOutputTest method testToGELFMessageTimestamp.
@Test
public void testToGELFMessageTimestamp() throws Exception {
final GelfTransport transport = mock(GelfTransport.class);
final GelfOutput gelfOutput = new GelfOutput(transport);
final DateTime now = DateTime.now(DateTimeZone.UTC);
final Message message = new Message("Test", "Source", now);
final GelfMessage gelfMessage = gelfOutput.toGELFMessage(message);
assertEquals(gelfMessage.getTimestamp(), now.getMillis() / 1000.0d, 0.0d);
}
Aggregations