final List<String> tags = (List<String>) message.getField("tags");
assertThat(tags).containsOnly("foobar", "test");
}
@Test
public void decodeMessagesHandlesPacketbeatMessages() throws Exception {
<BUG>final byte[] json = Resources.toByteArray(Resources.getResource("BeatsCodecTest/packetbeat-dns.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");

final List<String> tags = (List<String>) message.getField("tags");
assertThat(tags).containsOnly("foobar", "test");
}
@Test
public void decodeMessagesHandlesPacketbeatMessages() throws Exception {
final byte[] json = Resources.toByteArray(Resources.getResource("packetbeat-dns.json"));
final RawMessage rawMessage = new RawMessage(json);
final Message message = codec.decode(rawMessage);
assertThat(message).isNotNull();
assertThat(message.getSource()).isEqualTo("example.local");
