diff options
author | DeWayne Filppi <dewayne@cloudify.co> | 2017-10-05 17:15:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-05 17:15:32 +0000 |
commit | e976afc1819d5ed5f534de7d12771ebefeed76da (patch) | |
tree | 01d006e7f4f7b171aa80f5dd73502ba476d5032e /mso-catalog-db/src/test/java/org | |
parent | 7d38760015e812f03e86f549934f523db18cee61 (diff) | |
parent | 8b2db7277235a629b625172a298b63103c697743 (diff) |
Merge "Adding UT for MSO catalogdb POJO"
Diffstat (limited to 'mso-catalog-db/src/test/java/org')
3 files changed, 165 insertions, 0 deletions
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceTest.java new file mode 100644 index 0000000000..12c55e7a48 --- /dev/null +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceTest.java @@ -0,0 +1,67 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights 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 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.Service;
+
+/**
+ */
+
+public class ServiceTest {
+
+ @Test
+ public final void recipeDataTest() {
+ Service service = new Service();
+ service.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(service.getCreated() != null);
+ service.setDescription("description");
+ assertTrue(service.getDescription().equalsIgnoreCase("description"));
+
+ service.setModelInvariantUUID("action");
+ assertTrue(service.getModelInvariantUUID().equalsIgnoreCase("action"));
+
+ service.setModelName("modelName");
+ assertTrue(service.getModelName().equalsIgnoreCase("modelName"));
+
+ service.setModelUUID("modelUUID");
+ assertTrue(service.getModelUUID().equalsIgnoreCase("modelUUID"));
+ service.setModelVersion("modelVersion");
+ assertTrue(service.getModelVersion().equalsIgnoreCase("modelVersion"));
+ service.setServiceRole("serviceRole");
+ assertTrue(service.getServiceRole().equalsIgnoreCase("serviceRole"));
+ service.setToscaCsarArtifactUUID("toscaCsarArtifactUUID");
+ assertTrue(service.getToscaCsarArtifactUUID().equalsIgnoreCase("toscaCsarArtifactUUID"));
+
+ service.setServiceType("serviceType");
+ assertTrue(service.getServiceType().equalsIgnoreCase("serviceType"));
+ service.setRecipes(null);
+ assertTrue(service.getRecipes() == null);
+ service.setServiceResourceCustomizations(null);
+ assertTrue(service.getServiceResourceCustomizations() == null);
+
+ }
+
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToAllottedResourcesTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToAllottedResourcesTest.java new file mode 100644 index 0000000000..b2aaeeed4e --- /dev/null +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToAllottedResourcesTest.java @@ -0,0 +1,49 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights 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 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources;
+
+/**
+ */
+
+public class ServiceToAllottedResourcesTest {
+
+ @Test
+ public final void serviceToAllottedResourcesDataTest() {
+ ServiceToAllottedResources serviceToAllottedResources = new ServiceToAllottedResources();
+ serviceToAllottedResources.setArModelCustomizationUuid("arModelCustomizationUuid");
+ assertTrue(
+ serviceToAllottedResources.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));
+ serviceToAllottedResources.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(serviceToAllottedResources.getCreated() != null);
+ serviceToAllottedResources.setServiceModelUuid("serviceModelUuid");
+ assertTrue(serviceToAllottedResources.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));
+// assertTrue(serviceToAllottedResources.toString() != null);
+
+ }
+
+}
diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToResourceCustomizationTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToResourceCustomizationTest.java new file mode 100644 index 0000000000..337cf4b574 --- /dev/null +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/ServiceToResourceCustomizationTest.java @@ -0,0 +1,49 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights 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 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.db.catalog.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Timestamp;
+
+import org.junit.Test;
+import org.openecomp.mso.db.catalog.beans.ServiceToAllottedResources;
+
+/**
+ */
+
+public class ServiceToResourceCustomizationTest {
+
+ @Test
+ public final void serviceToResourceCustomizationDataTest() {
+ ServiceToAllottedResources serviceToResourceCustomization = new ServiceToAllottedResources();
+ serviceToResourceCustomization.setArModelCustomizationUuid("arModelCustomizationUuid");
+ assertTrue(
+ serviceToResourceCustomization.getArModelCustomizationUuid().equalsIgnoreCase("arModelCustomizationUuid"));
+ serviceToResourceCustomization.setCreated(new Timestamp(System.currentTimeMillis()));
+ assertTrue(serviceToResourceCustomization.getCreated() != null);
+ serviceToResourceCustomization.setServiceModelUuid("serviceModelUuid");
+ assertTrue(serviceToResourceCustomization.getServiceModelUuid().equalsIgnoreCase("serviceModelUuid"));
+// assertTrue(serviceToResourceCustomization.toString() != null);
+
+ }
+
+}
|