This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch kamelet-eip
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c528270a60df4b16c651421c97a0fbd6e595da8d
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Apr 13 13:32:21 2021 +0200

    CAMEL-16493: Kamelet EIP
---
 .../camel/component/kamelet/KameletProducer.java   |  1 -
 .../component/kamelet/KameletConsumeOnlyTest.java  | 55 ++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletProducer.java
 
b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletProducer.java
index 4adc427..d76937e 100644
--- 
a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletProducer.java
+++ 
b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/KameletProducer.java
@@ -83,7 +83,6 @@ final class KameletProducer extends DefaultAsyncProducer {
             } else {
                 if (sink) {
                     // need to execute the callback from the waiting
-                    // TODO: non EIP must also park!!!
                     AsyncProcessor parked = (AsyncProcessor) 
component.getCallback(key);
                     if (parked != null) {
                         return parked.process(exchange, callback);
diff --git 
a/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletConsumeOnlyTest.java
 
b/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletConsumeOnlyTest.java
new file mode 100644
index 0000000..15c5d2c
--- /dev/null
+++ 
b/components/camel-kamelet/src/test/java/org/apache/camel/component/kamelet/KameletConsumeOnlyTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.kamelet;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@Disabled
+public class KameletConsumeOnlyTest extends CamelTestSupport {
+
+    @Test
+    public void canConsumeFromKamelet() {
+        assertThat(
+                consumer.receiveBody("kamelet:tick", 
Integer.class)).isEqualTo(1);
+    }
+
+    // **********************************************
+    //
+    // test set-up
+    //
+    // **********************************************
+
+    @Override
+    protected RoutesBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                routeTemplate("tick")
+                        .from("timer:{{routeId}}?repeatCount=1&delay=-1")
+                        .setBody().exchangeProperty(Exchange.TIMER_COUNTER)
+                        .to("kamelet:sink");
+            }
+        };
+    }
+}

Reply via email to