You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/04/27 15:28:52 UTC

[camel-kamelets] branch main updated (17543e5 -> b981e02)

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

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git.


    from 17543e5  Camel-Kamelets-Catalog: Better naming
     new 8c8da92  Camel-Kamelets-Catalog: Better naming
     new b981e02  Camel-Kamelets-Catalog: More methods

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/camel/kamelets/catalog/KameletsCatalog.java     | 10 +++++++++-
 .../org/apache/camel/kamelets/catalog/KameletsCatalogTest.java | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

[camel-kamelets] 02/02: Camel-Kamelets-Catalog: More methods

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit b981e023197abd0bf417a7eb5d228617eaa9c9df
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Apr 27 17:28:34 2021 +0200

    Camel-Kamelets-Catalog: More methods
---
 .../org/apache/camel/kamelets/catalog/KameletsCatalog.java     | 10 +++++++++-
 .../org/apache/camel/kamelets/catalog/KameletsCatalogTest.java |  8 ++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java b/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java
index 083bf43..cc97425 100644
--- a/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java
+++ b/camel-kamelets-catalog/src/main/java/org/apache/camel/kamelets/catalog/KameletsCatalog.java
@@ -32,7 +32,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 public class KameletsCatalog {
 
@@ -91,4 +90,13 @@ public class KameletsCatalog {
             return null;
         }
     }
+
+    public List<String> getKameletRequiredProperties(String name) {
+        Kamelet kamelet = kameletModels.get(name);
+        if (kamelet != null) {
+            return kamelet.getSpec().getDefinition().getRequired();
+        } else {
+            return null;
+        }
+    }
 }
diff --git a/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java b/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
index 787493c..55297e0 100644
--- a/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
+++ b/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
+import java.util.List;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
@@ -58,6 +59,13 @@ public class KameletsCatalogTest {
     }
 
     @Test
+    void testGetKameletsRequiredProperties() throws Exception {
+        List<String> props = catalog.getKameletRequiredProperties("aws-sqs-source");
+        assertEquals(4, props.size());
+        assertTrue(props.contains("queueNameOrArn"));
+    }
+
+    @Test
     void testGetKameletsDefinitionNotExists() throws Exception {
         JSONSchemaProps props = catalog.getKameletDefinition("word");
         assertNull(props);

[camel-kamelets] 01/02: Camel-Kamelets-Catalog: Better naming

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 8c8da92a1a80d16caebda35f39b8290ca005a896
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Apr 27 17:12:35 2021 +0200

    Camel-Kamelets-Catalog: Better naming
---
 .../java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java b/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
index b3a68c6..787493c 100644
--- a/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
+++ b/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
@@ -59,7 +59,7 @@ public class KameletsCatalogTest {
 
     @Test
     void testGetKameletsDefinitionNotExists() throws Exception {
-        JSONSchemaProps props = catalog.getKameletsDefinition("word");
+        JSONSchemaProps props = catalog.getKameletDefinition("word");
         assertNull(props);
     }
 }