@Test
public void testSetCamelPropertiesUnknownOption() throws Exception {

    MyClass target = new MyClass();
    Map<String, Object> map = new LinkedHashMap<>();
    map.put("id", "123");
    map.put("name", "Donald Duck");
    map.put("option", "#myCoolOption");
    map.put("unknown", "foo");
    try {
        CamelPropertiesHelper.setCamelProperties(camelContext, target, map, true);
        Assert.fail("Should have thrown exception");
    } catch (IllegalArgumentException e) {
        // expected
        Assert.assertTrue(e.getMessage().startsWith("Cannot configure option [unknown] with value [foo]"));
    }
    Assert.assertEquals("Should configure the three first options", 1, map.size());
    Assert.assertEquals(123, target.getId());
    Assert.assertEquals("Donald Duck", target.getName());
    Assert.assertSame(context.getBean("myCoolOption"), target.getOption());
}