unit tests - openecomp-be 27/94727/2
authorPiotr Darosz <piotr.darosz@nokia.com>
Sun, 1 Sep 2019 13:05:38 +0000 (15:05 +0200)
committerTomasz Golabek <tomasz.golabek@nokia.com>
Mon, 2 Sep 2019 06:41:00 +0000 (06:41 +0000)
Additional junit tests for dao-types

Issue-ID: SDC-2326
Signed-off-by: Piotr Darosz <piotr.darosz@nokia.com>
Change-Id: I195610e66628d5d8546846592c98c726ba81824d

openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntityTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentMonitoringUploadEntityTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateDataEntityTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfoTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntityTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileDataTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetailsTest.java [new file with mode: 0644]
openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntityTest.java [new file with mode: 0644]

diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntityTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentDependencyModelEntityTest.java
new file mode 100644 (file)
index 0000000..2af1505
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertThat;
+
+public class ComponentDependencyModelEntityTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(ComponentDependencyModelEntity.class,
+                hasValidGettersAndSettersExcluding("entityType", "firstClassCitizenId"));
+    }
+
+
+    @Test
+    public void equalsTest() {
+        String vspId = "1";
+        Version version = new Version("2");
+        String dependencyId = "3";
+        ComponentDependencyModelEntity obj = null;
+        ComponentDependencyModelEntity componentDependencyModelEntity =
+                new ComponentDependencyModelEntity(vspId, version, dependencyId);
+        assertNotEquals(componentDependencyModelEntity, obj);
+        obj = new ComponentDependencyModelEntity(vspId, version, dependencyId);
+        assertEquals(componentDependencyModelEntity, obj);
+    }
+
+    @Test
+    public void hashCodeTest() {
+        String vspId = "1";
+        Version version = new Version("2");
+        String dependencyId = "3";
+        ComponentDependencyModelEntity obj = new ComponentDependencyModelEntity(vspId, version, dependencyId);
+        ComponentDependencyModelEntity componentDependencyModelEntity =
+                new ComponentDependencyModelEntity(vspId, version, dependencyId);
+
+        assertEquals(obj.hashCode(), componentDependencyModelEntity.hashCode());
+        assertNotEquals(obj.hashCode(), null);
+        assertNotEquals(componentDependencyModelEntity.hashCode(), 0);
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentMonitoringUploadEntityTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ComponentMonitoringUploadEntityTest.java
new file mode 100644 (file)
index 0000000..525925d
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
+import static org.junit.Assert.assertThat;
+
+public class ComponentMonitoringUploadEntityTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(ComponentMonitoringUploadEntity.class,
+                hasValidGettersAndSettersExcluding("entityType", "firstClassCitizenId"));
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateDataEntityTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/OrchestrationTemplateCandidateDataEntityTest.java
new file mode 100644 (file)
index 0000000..76dc7d0
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
+import static org.junit.Assert.assertThat;
+
+public class OrchestrationTemplateCandidateDataEntityTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(OrchestrationTemplateCandidateDataEntity.class,
+                hasValidGettersAndSettersExcluding("entityType", "firstClassCitizenId"));
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfoTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/PackageInfoTest.java
new file mode 100644 (file)
index 0000000..ea8925b
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
+import static org.junit.Assert.assertThat;
+
+public class PackageInfoTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(PackageInfo.class,
+                hasValidGettersAndSetters());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntityTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ProcessEntityTest.java
new file mode 100644 (file)
index 0000000..91a92e4
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertThat;
+
+public class ProcessEntityTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(ProcessEntity.class,
+                hasValidGettersAndSettersExcluding("entityType", "firstClassCitizenId"));
+    }
+
+    @Test
+    public void equalsTest() {
+        String vspId = "1";
+        Version version = new Version("2");
+        String componentId = "3";
+        String id = "4";
+        ProcessEntity obj = null;
+        ProcessEntity processEntity = new ProcessEntity(vspId, version, componentId, id);
+        assertNotEquals(processEntity, obj);
+        obj = new ProcessEntity(vspId, version, componentId, id);
+        assertEquals(processEntity, obj);
+    }
+
+    @Test
+    public void hashCodeTest() {
+        String vspId = "1";
+        Version version = new Version("2");
+        String componentId = "3";
+        String id = "4";
+        ProcessEntity obj = new ProcessEntity(vspId, version, componentId, id);
+        ProcessEntity processEntity = new ProcessEntity(vspId, version, componentId, id);
+
+        assertEquals(obj.hashCode(), processEntity.hashCode());
+        assertNotEquals(obj.hashCode(), null);
+        assertNotEquals(processEntity.hashCode(), 0);
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileDataTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/TranslatedFileDataTest.java
new file mode 100644 (file)
index 0000000..1d12a4b
--- /dev/null
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
+import static org.junit.Assert.assertThat;
+
+public class TranslatedFileDataTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(TranslatedFileData.class,
+                hasValidGettersAndSetters());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetailsTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspDetailsTest.java
new file mode 100644 (file)
index 0000000..66f6bf2
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
+import static org.junit.Assert.assertThat;
+
+public class VspDetailsTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(VspDetails.class,
+                hasValidGettersAndSettersExcluding("compositionData", "compositionEntityId", "entityType",
+                        "firstClassCitizenId", "type"));
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntityTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/VspQuestionnaireEntityTest.java
new file mode 100644 (file)
index 0000000..07e3f31
--- /dev/null
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Nokia. 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.sdc.vendorsoftwareproduct.dao.type;
+
+import org.junit.Test;
+
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding;
+import static org.junit.Assert.assertThat;
+
+public class VspQuestionnaireEntityTest {
+    @Test
+    public void accessorsTest() {
+        assertThat(VspQuestionnaireEntity.class,
+                hasValidGettersAndSettersExcluding("compositionData", "compositionEntityId", "entityType",
+                        "firstClassCitizenId", "type"));
+    }
+}
\ No newline at end of file