@Test
public void testDecodeRawSetsException() throws Exception {

    byte[] dataSet = IpfixUtilities.hexStringToByteArray("0103012000000061BC0503000F6161000000DE00000000014D6262000001BC0503000318A3286FFFF00000E910" +
            "0103012000000061BC0503000F6161000000DE00000000014D6262000001BC0503000318A3286FFFF00000E91000014D6262000001BC0503000318A3286FFFF00000E91001" +
            "0103012000000061BC0503000F6161000000DE00000000014D6262000001BC0503000318A3286FFFF00000E91000014D6262000001BC0503000318A3286FFFF00000E91002" +
            "0103012000000061BC0503000F6161000000DE00000000014D6262000001BC0503000318A3286FFFF00000E91000014D6262000001BC0503000318A3286FFFF00000E91002" +
            "0103012000000061BC0503000F6161000000DE00000000014D6262000001BC0503000318A3286FFFF00000E91000014D6262000001BC0503000318A3286FFFF00000E91003");
    byte[] dataTemplateRecord = IpfixUtilities.hexStringToByteArray("01030004008D000400290002802A000400000E918286FFFF00000E91");
    IpfixDataSet set = new IpfixDataSet(dataSet);
    AbstractTemplateRecord blueprint = new IpfixTemplateRecord(dataTemplateRecord);
    when(m_templateProvider.get(259)).thenReturn(blueprint);
    InformationElement ie32 = mock(InformationElement.class);
    String hostName = "hostname";
    String family = "sample-model-tls-DPU-1.0";
    when(m_deviceFamilyCacheService.getDeviceFamily(hostName)).thenReturn(family);
    when(m_informationElementService.getInformationElement(family, 646)).thenReturn(ie32);
    when(ie32.getDataType()).thenReturn(InformationElementType.UNSIGNED32);
    try {
        m_decodingDataRecordService.decodeDataSet(hostName, 1L, set, null, m_templateProvider);
        fail();
    } catch (DecodingException e) {
        assertEquals("Error decoding data set: " + set + ", with template set: " + blueprint + " on the device: hostname", e.getMessage());
    }
}