aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
authorezhil <ezhrajam@in.ibm.com>2018-09-27 16:23:37 +0530
committerEzhilarasi R <ezhrajam@in.ibm.com>2018-09-27 10:59:46 +0000
commit4c6ebe3ebe569e3928c96d97ea9f2578b4ff3d51 (patch)
tree9123193dc3b8d7e4b11f1bf43c2cc04e9aaa439f /ms/controllerblueprints
parentbd3fe2520ec91c5e9424304d4cf9b2fd15fb15d0 (diff)
Added test file to ModelTypeValidator
Added test class file for ModelTypeValidator Issue-ID: CCSDK-594 Change-Id: I11de4b3a62db499399b2051a4096d3f098d1e135 Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java
new file mode 100644
index 000000000..a5eb661af
--- /dev/null
+++ b/ms/controllerblueprints/modules/service/src/test/java/org/onap/ccsdk/apps/controllerblueprints/service/validator/ModelTypeValidatorTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright © 2018 IBM.
+ *
+ * Licensed 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.onap.ccsdk.apps.controllerblueprints.service.validator;
+
+import static org.junit.Assert.*;
+
+import org.junit.*;
+import org.onap.ccsdk.apps.controllerblueprints.service.validator.ModelTypeValidator;
+import org.onap.ccsdk.apps.controllerblueprints.service.domain.ModelType;
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class ModelTypeValidatorTest {
+
+ @Before
+ public void setup(){
+ ModelTypeValidator modelTypeValidator;
+ }
+
+ @Test
+ public void testGetValidModelDefinitionType_definitionContentNULL() throws Exception{
+ String definitionType=null;
+ JsonNode definitionContent=null;
+ boolean valid= ModelTypeValidator.validateModelTypeDefinition(definitionType, definitionContent);
+ Assert.assertTrue(valid);
+
+ }
+
+ @Test(expected=BluePrintException.class)
+ public void testvalidateModelType() throws Exception{
+ ModelType modelType = new ModelType();
+ modelType.setDefinitionType("");
+ modelType.setDerivedFrom("");
+ modelType.setDescription("");
+ JsonNode definitionContent=null;
+ modelType.setDefinition(definitionContent);
+ modelType.setModelName("");
+ modelType.setVersion("");
+ modelType.setTags("");
+ modelType.setUpdatedBy("");
+ ModelTypeValidator.validateModelType(modelType);
+ }
+}