@Test
public void testDecodeDataWhenFamilyIsNotAvailable() throws Exception {

    String hostName = "hostname";
    byte[] dataSet = IpfixUtilities.hexStringToByteArray("010300200000006F6161000000DE00000000014D6262000001BC0503000318A3");
    byte[] dataTemplateRecord = IpfixUtilities.hexStringToByteArray("01030004008D000400290002802A000400000E918286FFFF00000E91");
    IpfixDataSet set = new IpfixDataSet(dataSet);
    AbstractTemplateRecord blueprint = new IpfixTemplateRecord(dataTemplateRecord);
    when(m_templateProvider.get(259)).thenReturn(blueprint);
    try {
        m_decodingDataRecordService.decodeDataSet(hostName, 1L, set, null, m_templateProvider);
        fail();
    } catch (DecodingException e) {
        verify(m_deviceFamilyCacheService).getDeviceFamily(hostName);
        assertEquals("Could not find device family based on the deviceName: " + hostName, e.getMessage());
    }
}