This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 41a8f36b Add unit test for default property placeholder syntax
41a8f36b is described below
commit 41a8f36b471c6fc613917cceb02e1da16cc9e0d6
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Feb 16 13:00:39 2021 +0100
Add unit test for default property placeholder syntax
---
.../PropertyPlaceholderDefaultValueTest.java | 44 ++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git
a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertyPlaceholderDefaultValueTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertyPlaceholderDefaultValueTest.java
new file mode 100644
index 0000000..3fdfd68
--- /dev/null
+++
b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertyPlaceholderDefaultValueTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.properties;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class PropertyPlaceholderDefaultValueTest extends ContextTestSupport {
+
+ @Test
+ public void testUsingDefaultValue() throws Exception {
+ getMockEndpoint("mock:bar").expectedBodiesReceived("Hello Camel");
+ getMockEndpoint("mock:foo").expectedMessageCount(0);
+
+ template.sendBody("direct:start", "Hello Camel");
+
+ assertMockEndpointsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").to("mock:{{foo:bar}}");
+ }
+ };
+ }
+}