aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src/test/java/org
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2019-01-23 16:42:13 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2019-01-23 16:46:27 +0530
commit402f8dc916e938a55dd54f721b3ce3928a7409a0 (patch)
tree663b7ec91d2d8c489a3181a7fb0830c11b4385fe /adapters/mso-catalog-db-adapter/src/test/java/org
parent89994c89aac5004bc892c8f8ca666bcb32ea4fb9 (diff)
Fix get of operationType
OperationType should return empty from db request instead of "null". Change-Id: I5df3df5aead6008c4e14961ee385cafe64c37959 Issue-ID: SO-1417 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/test/java/org')
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java
index 645714cc80..e403867c42 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/QueryResourceRecipeTest.java
@@ -21,11 +21,16 @@
package org.onap.so.adapters.catalogdb.catalogrest;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertEquals;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.onap.so.db.catalog.beans.ArRecipe;
+import org.onap.so.db.catalog.beans.NetworkRecipe;
import org.onap.so.db.catalog.beans.Recipe;
import org.onap.so.db.catalog.beans.ServiceRecipe;
+import org.onap.so.db.catalog.beans.VnfRecipe;
import org.onap.so.jsonpath.JsonPathUtil;
public class QueryResourceRecipeTest {
@@ -67,4 +72,24 @@ public class QueryResourceRecipeTest {
return recipe;
}
+ @Test
+ public void convertToJson() {
+ Recipe recipe = createRecipe();
+ QueryResourceRecipe queryResourceRecipe = new QueryResourceRecipe(recipe);
+ assertEquals("{\"orchestrationUri\":\"uriTest\",\"action\":\"actionTest\",\"description\":\"descrTest\",\"id\":\"123\",\"recipeTimeout\":\"100\",\"paramXSD\":\"paramsXsdTest\"}",
+ queryResourceRecipe.JSON2(false,false));
+ }
+
+ @Test
+ public void convertToJsonEmptyRecipe() {
+ QueryResourceRecipe vnfQueryRR = new QueryResourceRecipe(new VnfRecipe());
+ QueryResourceRecipe networkQueryRR = new QueryResourceRecipe(new NetworkRecipe());
+ QueryResourceRecipe arQueryRR = new QueryResourceRecipe(new ArRecipe());
+
+ String expected = "{\"orchestrationUri\":\"\",\"action\":\"\",\"description\":\"\",\"id\":\"\",\"recipeTimeout\":\"\",\"paramXSD\":\"\"}";
+ assertEquals(expected, vnfQueryRR.JSON2(false, false));
+ assertEquals(expected, networkQueryRR.JSON2(false,false));
+ assertEquals(expected, arQueryRR.JSON2(false,false));
+ }
+
}