Skip to content

Commit

Permalink
Fix apache#129 Properies evaluation broken after the introduction of …
Browse files Browse the repository at this point in the history
…PropertyBindingSupport
  • Loading branch information
ppalaga committed Aug 12, 2019
1 parent dce74db commit d4e5f6b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ protected <T> T resolve(Class<T> clazz, String type, String name, CamelContext c
this,
result,
new HashMap<>((Map) props),
CamelRuntime.PFX_CAMEL + type + "." + name);
CamelRuntime.PFX_CAMEL + type + "." + name + ".");
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.ws.rs.core.MediaType;

import org.apache.camel.Route;
import org.apache.camel.component.timer.TimerComponent;
import org.apache.camel.quarkus.core.runtime.CamelRuntime;

@Path("/")
Expand All @@ -51,4 +52,11 @@ public String getProperty(@PathParam("name") String name) throws Exception {

return runtime.getContext().resolvePropertyPlaceholders(prefix + name + suffix);
}

@Path("/timer/resolve-property-placeholders")
@GET
@Produces(MediaType.TEXT_PLAIN)
public boolean timerResolvePropertyPlaceholders() throws Exception {
return runtime.getContext().getComponent("timer", TimerComponent.class).isResolvePropertyPlaceholders();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ quarkus.camel.defer-init-phase=true
#
camel.context.name=quarkus-camel-example

# Timer
camel.component.timer.resolve-property-placeholders = false
#
# Integration
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
*/
package org.apache.camel.quarkus.core;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.Test;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;

@QuarkusTest
public class CamelTest {

@Test
public void testRoutes() {
RestAssured.when().get("/test/routes").then().body(containsString("timer"));
Expand All @@ -34,4 +36,11 @@ public void testRoutes() {
public void testProperties() {
RestAssured.when().get("/test/property/camel.context.name").then().body(is("quarkus-camel-example"));
}

@Test
public void timerPropertyPropagated() {
RestAssured.when().get("/test/property/camel.component.timer.resolve-property-placeholders").then().body(is("false"));
RestAssured.when().get("/test/timer/resolve-property-placeholders").then().body(is("false"));
}

}

0 comments on commit d4e5f6b

Please sign in to comment.