summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml1
-rw-r--r--so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/pom.xml6
-rw-r--r--so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/src/test/java/org/onap/so/cnfm/lcm/database/PojoClassesTests.java40
3 files changed, 47 insertions, 0 deletions
diff --git a/pom.xml b/pom.xml
index e6aec53..ecd0433 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,6 +25,7 @@
<snakeyaml-version>0.11</snakeyaml-version>
<kubernetes-client-version>16.0.0</kubernetes-client-version>
<kotlin-stdlib-version>1.3.70</kotlin-stdlib-version>
+ <openpojo-version>0.8.3</openpojo-version>
</properties>
<build>
diff --git a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/pom.xml b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/pom.xml
index 0a94e2e..ff73b20 100644
--- a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/pom.xml
+++ b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/pom.xml
@@ -45,5 +45,11 @@
<version>${so-core-version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <version>${openpojo-version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/src/test/java/org/onap/so/cnfm/lcm/database/PojoClassesTests.java b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/src/test/java/org/onap/so/cnfm/lcm/database/PojoClassesTests.java
index 917e7de..9f242a1 100644
--- a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/src/test/java/org/onap/so/cnfm/lcm/database/PojoClassesTests.java
+++ b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-database-service/src/test/java/org/onap/so/cnfm/lcm/database/PojoClassesTests.java
@@ -28,6 +28,12 @@ import org.onap.so.cnfm.lcm.database.beans.AsLcmOpOcc;
import org.onap.so.cnfm.lcm.database.beans.AsLifecycleParam;
import org.onap.so.cnfm.lcm.database.beans.Job;
import org.onap.so.cnfm.lcm.database.beans.JobStatus;
+import org.onap.so.openpojo.rules.ToStringTester;
+import com.openpojo.reflection.impl.PojoClassFactory;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
@@ -36,6 +42,9 @@ import nl.jqno.equalsverifier.Warning;
*/
public class PojoClassesTests {
+ private static final Validator VALIDATOR = ValidatorBuilder.create().with(new SetterTester())
+ .with(new GetterTester()).with(new ToStringTester()).build();
+
@Test
public void test_database_job_equalAndHashMethod() throws ClassNotFoundException {
EqualsVerifier.forClass(Job.class)
@@ -45,6 +54,11 @@ public class PojoClassesTests {
}
@Test
+ public void test_database_job_getterSetterMethod() {
+ VALIDATOR.validate(PojoClassFactory.getPojoClass(Job.class));
+ }
+
+ @Test
public void test_database_jobStatus_equalAndHashMethod() throws ClassNotFoundException {
EqualsVerifier.forClass(JobStatus.class)
.suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS, Warning.INHERITED_DIRECTLY_FROM_OBJECT)
@@ -53,6 +67,11 @@ public class PojoClassesTests {
}
@Test
+ public void test_database_jobStatus_getterSetterMethod() {
+ VALIDATOR.validate(PojoClassFactory.getPojoClass(JobStatus.class));
+ }
+
+ @Test
public void test_database_asInst_equalAndHashMethod() throws ClassNotFoundException {
EqualsVerifier.forClass(AsInst.class)
.suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS, Warning.INHERITED_DIRECTLY_FROM_OBJECT)
@@ -61,6 +80,11 @@ public class PojoClassesTests {
}
@Test
+ public void test_database_asInst_getterSetterMethod() {
+ VALIDATOR.validate(PojoClassFactory.getPojoClass(AsInst.class));
+ }
+
+ @Test
public void test_database_asdeploymentItem_equalAndHashMethod() throws ClassNotFoundException {
EqualsVerifier.forClass(AsDeploymentItem.class)
.suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS, Warning.INHERITED_DIRECTLY_FROM_OBJECT)
@@ -70,6 +94,12 @@ public class PojoClassesTests {
}
@Test
+ public void test_database_asdeploymentItem_getterSetterMethod() {
+ VALIDATOR.validate(PojoClassFactory.getPojoClass(AsDeploymentItem.class));
+ }
+
+
+ @Test
public void test_database_asLcmOpOcc_equalAndHashMethod() throws ClassNotFoundException {
EqualsVerifier.forClass(AsLcmOpOcc.class)
.suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS, Warning.INHERITED_DIRECTLY_FROM_OBJECT)
@@ -78,6 +108,11 @@ public class PojoClassesTests {
}
@Test
+ public void test_database_asLcmOpOcc_getterSetterMethod() {
+ VALIDATOR.validate(PojoClassFactory.getPojoClass(AsLcmOpOcc.class));
+ }
+
+ @Test
public void test_database_asLifecycleParam_equalAndHashMethod() throws ClassNotFoundException {
EqualsVerifier.forClass(AsLifecycleParam.class)
.suppress(Warning.STRICT_INHERITANCE, Warning.NONFINAL_FIELDS, Warning.INHERITED_DIRECTLY_FROM_OBJECT)
@@ -85,4 +120,9 @@ public class PojoClassesTests {
.withIgnoredAnnotations(Entity.class, Id.class).verify();
}
+ @Test
+ public void test_database_asLifecycleParam_getterSetterMethod() {
+ VALIDATOR.validate(PojoClassFactory.getPojoClass(AsLifecycleParam.class));
+ }
+
}