private Object getKey(final Message message) throws Exception {
        Object value;
        if (configuration.getKeyType() != null) {
            Class<?> clazz = getEndpoint().getCamelContext().getClassResolver().resolveClass(configuration.getKeyType());
            value = message.getHeader(EhcacheConstants.KEY, clazz);
        } else {
            value = message.getHeader(EhcacheConstants.KEY);
        }
        if (value == null) {
            value = configuration.getKey();
        }

        if (value == null) {
            throw new CamelExchangeException(
                    "No value provided in header or as default value (" + EhcacheConstants.KEY + ")",
                    message.getExchange());
        }

        return value;
    }
@Test
    void testCacheRemoveAll() throws Exception {
        final Cache<Object, Object> cache = getTestCache();
        final Map<String, String> map = generateRandomMapOfString(3);
        final Set<String> keys = map.keySet().stream().limit(2).collect(Collectors.toSet());

        cache.putAll(map);

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        mock.expectedHeaderReceived(EhcacheConstants.ACTION_HAS_RESULT, false);
        mock.expectedHeaderReceived(EhcacheConstants.ACTION_SUCCEEDED, true);

        fluentTemplate()
                .withHeader(EhcacheConstants.ACTION, EhcacheConstants.ACTION_REMOVE_ALL)
                .withHeader(EhcacheConstants.KEYS, keys)
                .to("direct://start")
                .send();

        MockEndpoint.assertIsSatisfied(context);

        cache.forEach(e -> assertFalse(keys.contains(e.getKey())));
    }