This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 5d14bf2 Add test cases for the MavenGav class (#5763)
5d14bf2 is described below
commit 5d14bf21dbd869d0e54f8c7efb836211b08984a9
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Tue Jun 29 10:37:58 2021 +0200
Add test cases for the MavenGav class (#5763)
---
dsl/camel-kamelet-main/pom.xml | 8 +++++
.../java/org/apache/camel/main/MavenGavTest.java | 41 ++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/dsl/camel-kamelet-main/pom.xml b/dsl/camel-kamelet-main/pom.xml
index e8c0375..c6710d3 100644
--- a/dsl/camel-kamelet-main/pom.xml
+++ b/dsl/camel-kamelet-main/pom.xml
@@ -71,6 +71,14 @@
<artifactId>camel-yaml-dsl</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git
a/dsl/camel-kamelet-main/src/test/java/org/apache/camel/main/MavenGavTest.java
b/dsl/camel-kamelet-main/src/test/java/org/apache/camel/main/MavenGavTest.java
new file mode 100644
index 0000000..e01dccf
--- /dev/null
+++
b/dsl/camel-kamelet-main/src/test/java/org/apache/camel/main/MavenGavTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.main;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class MavenGavTest {
+
+ @Test
+ void parseCamelGav() {
+ MavenGav gav = MavenGav.parseGav("camel:camel-core");
+
+ assertEquals("org.apache.camel", gav.getGroupId());
+ assertEquals("camel-core", gav.getArtifactId());
+ }
+
+ @Test
+ void parseOtherGav() {
+ MavenGav gav = MavenGav.parseGav("mvn:org.junit:junit-api:99.99");
+
+ assertEquals("org.junit", gav.getGroupId());
+ assertEquals("junit-api", gav.getArtifactId());
+ assertEquals("99.99", gav.getVersion());
+ }
+}