Changes include Metadata support, Upload tosca policy model and Loop Template
[clamp.git] / src / test / java / org / onap / clamp / util / SemanticVersioningTest.java
index 1fb5922..e018f09 100644 (file)
@@ -6,27 +6,27 @@
  *                             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;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 import org.junit.Test;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 public class SemanticVersioningTest {
 
     @Test
@@ -68,4 +68,12 @@ public class SemanticVersioningTest {
         assertThat(SemanticVersioning.compare(null, "1.0")).isEqualTo(-1);
         assertThat(SemanticVersioning.compare("1.0", null)).isEqualTo(1);
     }
+
+    @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");
+    }
 }