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 fcb0a56
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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 @@ -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 @@ -18,13 +18,24 @@

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

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

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

import javax.inject.Inject;

import org.apache.camel.CamelContext;
import org.apache.camel.component.timer.TimerComponent;

@QuarkusTest
public class CamelTest {

@Inject
CamelContext camelContext;

@Test
public void testRoutes() {
RestAssured.when().get("/test/routes").then().body(containsString("timer"));
Expand All @@ -34,4 +45,14 @@ 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"));
Assertions.assertNotNull(camelContext);
final TimerComponent timerComponent = camelContext.getComponent("timer", TimerComponent.class);
Assertions.assertNotNull(timerComponent);
Assertions.assertFalse(timerComponent.isResolvePropertyPlaceholders());
}

}

0 comments on commit fcb0a56

Please sign in to comment.