assertThat(message.getField("facility")).isEqualTo("packetbeat");
assertThat(message.getField("type")).isEqualTo("dns");
}
@Test
public void decodeMessagesHandlesTopbeatMessages() throws Exception {
<BUG>final byte[] json = Resources.toByteArray(Resources.getResource("BeatsCodecTest/topbeat-system.json"));
final RawMessage rawMessage = new RawMessage(json);
final Collection<Message> messages = codec.decodeMessages(rawMessage);
assertThat(messages)

.isNotNull()
.hasSize(1);
final Message message = messages.iterator().next();</BUG>
assertThat(message.getSource()).isEqualTo("example.local");

assertThat(message.getField("facility")).isEqualTo("packetbeat");
assertThat(message.getField("type")).isEqualTo("dns");
}
@Test
public void decodeMessagesHandlesTopbeatMessages() throws Exception {
final byte[] json = Resources.toByteArray(Resources.getResource("topbeat-system.json"));
final RawMessage rawMessage = new RawMessage(json);
final Message message = codec.decode(rawMessage);
assertThat(message).isNotNull();
assertThat(message.getSource()).isEqualTo("example.local");
