Fix the new tosca converter
[clamp.git] / src / test / java / org / onap / clamp / util / SemanticVersioningTest.java
index 1fb5922..88f2bbe 100644 (file)
@@ -6,19 +6,19 @@
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with 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 
+ *
+ * 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.
  * ============LICENSE_END============================================
  * ===================================================================
- * 
+ *
  */
 
 package org.onap.clamp.util;
@@ -29,6 +29,9 @@ import org.junit.Test;
 
 public class SemanticVersioningTest {
 
+    /**
+     * compare test.
+     */
     @Test
     public void compareTest() {
         assertThat(SemanticVersioning.compare("1.0.0", "2.0.0")).isEqualTo(-1);
@@ -53,6 +56,9 @@ public class SemanticVersioningTest {
         assertThat(SemanticVersioning.compare("1.2", "1")).isEqualTo(1);
     }
 
+    /**
+     * Compare test.
+     */
     @Test
     public void compareEqualsTest() {
         assertThat(SemanticVersioning.compare("1.0.0", "1.0.0")).isEqualTo(0);
@@ -62,10 +68,24 @@ public class SemanticVersioningTest {
 
     }
 
+    /**
+     * Compare with null.
+     */
     @Test
     public void compareNullTest() {
         assertThat(SemanticVersioning.compare(null, null)).isEqualTo(0);
         assertThat(SemanticVersioning.compare(null, "1.0")).isEqualTo(-1);
         assertThat(SemanticVersioning.compare("1.0", null)).isEqualTo(1);
     }
+
+    /**
+     * Increment major version test.
+     */
+    @Test
+    public void incrementVersionTest() {
+        assertThat(SemanticVersioning.incrementMajorVersion("1.0")).isEqualTo("2.0.0");
+        assertThat(SemanticVersioning.incrementMajorVersion("1.0.0")).isEqualTo("2.0.0");
+        assertThat(SemanticVersioning.incrementMajorVersion("1")).isEqualTo("2.0.0");
+        assertThat(SemanticVersioning.incrementMajorVersion("1.2.3")).isEqualTo("2.0.0");
+    }
 }