public Exchange unmarshallExchange(CamelContext camelContext, byte[] buffer, String deserializationFilter)
            throws IOException, ClassNotFoundException {
        return unmarshallExchange(camelContext, new ByteArrayInputStream(buffer), deserializationFilter);
    }
@Test
    public void shouldFailWithRejected() throws IOException, ClassNotFoundException {
        Employee emp = new Employee("Mickey", "Mouse");

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);

        oos.writeObject(emp);

        oos.flush();
        oos.close();

        InputStream is = new ByteArrayInputStream(baos.toByteArray());
        InvalidClassException thrown = Assertions.assertThrows(InvalidClassException.class, () -> {
            codec.unmarshallExchange(context, is, "java.**;org.apache.camel.**;!*");
        });

        Assertions.assertEquals("filter status: REJECTED", thrown.getMessage());
    }