@Test
public void testDecode_Udp() throws Exception {

    byte[] ethPayload = {
        // Eth start
        (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, (byte)0xff, 0x06, 0x27, 0x25, 0x06, (byte)0x81,
        (byte)0x81, 0x08, 0x00,
        // Ipv4 start
        0x45, 0x10, 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, (byte)0x80, 0x11, 0x39, (byte)0x96, 0x00, 0x00, 0x00, 0x00,
        (byte)0xff, (byte)0xff,
        (byte)0xff, (byte)0xff,
        // Udp start
        0x00, 0x44, 0x00, 0x43, 0x01, 0x34, 0x2d, (byte)0xf5, 0x01, 0x01, 0x06, 0x00, (byte)0xdf, (byte)0xcc
    };
    NotificationProviderService npServiceMock = Mockito.mock(NotificationProviderService.class);
    ArrayList<PacketChain> packetChainList = new ArrayList<>();
    packetChainList.add(new PacketChainBuilder().setPacket(new RawPacketBuilder().build()).build());
    packetChainList.add(
            new PacketChainBuilder().setPacket(new EthernetPacketBuilder().setPayloadOffset(14).build()).build());
    Ipv4PacketReceived notification = new Ipv4Decoder(npServiceMock).decode(
            new EthernetPacketReceivedBuilder().setPacketChain(packetChainList).setPayload(ethPayload).build());
    Ipv4Packet ipv4Packet = (Ipv4Packet) notification.getPacketChain().get(2).getPacket();
    assertEquals(4, ipv4Packet.getVersion().intValue());
    assertEquals(5, ipv4Packet.getIhl().intValue());
    assertEquals(4, ipv4Packet.getDscp().getValue().intValue());
    assertEquals(0, ipv4Packet.getEcn().intValue());
    assertEquals(328, ipv4Packet.getIpv4Length().intValue());
    assertEquals(0, ipv4Packet.getId().intValue());
    assertFalse(ipv4Packet.isReservedFlag());
    assertFalse(ipv4Packet.isDfFlag());
    assertFalse(ipv4Packet.isMfFlag());
    assertEquals(0, ipv4Packet.getFragmentOffset().intValue());
    assertEquals(128, ipv4Packet.getTtl().intValue());
    assertEquals(KnownIpProtocols.Udp, ipv4Packet.getProtocol());
    assertEquals(14742, ipv4Packet.getChecksum().intValue());
    Ipv4Address srcAddress = new Ipv4Address("0.0.0.0");
    Ipv4Address dstAddress = new Ipv4Address("255.255.255.255");
    assertEquals(srcAddress, ipv4Packet.getSourceIpv4());
    assertEquals(dstAddress, ipv4Packet.getDestinationIpv4());
    assertEquals(34, ipv4Packet.getPayloadOffset().intValue());
    // Not testing payloadLength because wireshark does not show crc
    assertTrue(Arrays.equals(ethPayload, notification.getPayload()));
}