Description
I'm trying to bind some properties to an object that has a filed of type Map<String, Object> and it looks like that when the keys for the map contain a dot, the the mapping fails.
As example:
Map<String, Object> properties = mapOf( "resources[0].name", "knative3", "resources[0].type", "endpoint", "resources[0].metadata[knative.apiVersion]", "serving.knative.dev/v1", "resources[0].metadata[knative.kind]", "Service", ); CamelContext context = new DefaultCamelContext(); KnativeEnvironment env = KnativeEnvironment.mandatoryLoadFromProperties(context, properties); List<KnativeResource> res = env.lookup(Knative.Type.endpoint, "knative3").collect(Collectors.toList()); assertThat(res).hasSize(1); assertThat(res).first().satisfies(resource -> { assertThat(resource.getName()).isEqualTo("knative3"); assertThat(resource.getMetadata()).isNotEmpty(); });
This code fails as resource.getMetadata() return an empty map, if the properties are then changed to:
Map<String, Object> properties = mapOf( "resources[0].name", "knative3", "resources[0].type", "endpoint", "resources[0].metadata[knative_apiVersion]", "serving.knative.dev/v1", "resources[0].metadata[knative_kind]", "Service", );
Then the test succeeds.