aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-03-06 14:25:02 +0200
committerIttay Stern <ittay.stern@att.com>2019-03-06 17:54:56 +0200
commit54aad7deb7a02ecca4bc7ed4d7913ccd59eb3bf9 (patch)
tree84250549f1d7e91234a41960866098d5d147ebbf /vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java
parent7c64fbbaff5985acb3a6aea977c5c15b4f2f59e1 (diff)
Fix cyclic CategoryParameterOption::hashCode
Issue-ID: VID-430 Change-Id: Ib49b71726fe508f1ec9bfe8c60836af1c5ca786b Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java186
1 files changed, 15 insertions, 171 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java b/vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java
index 5fe392751..a3a14a2dd 100644
--- a/vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/model/CategoryParameterOptionTest.java
@@ -20,190 +20,34 @@
package org.onap.vid.model;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
+import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanEqualsExcluding;
+import static com.google.code.beanmatchers.BeanMatchers.hasValidBeanHashCodeExcluding;
+import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters;
+import static org.hamcrest.MatcherAssert.assertThat;
-import org.junit.Assert;
+import org.apache.commons.lang3.ArrayUtils;
import org.junit.Test;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import org.onap.vid.testUtils.TestUtils;
public class CategoryParameterOptionTest {
- private CategoryParameterOption createTestSubject() {
- return new CategoryParameterOption();
- }
-
- @Test
- public void testGetId() throws Exception {
- CategoryParameterOption testSubject;
- Long result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getId();
- }
-
- @Test
- public void testSetId() throws Exception {
- CategoryParameterOption testSubject;
- Long id = null;
-
- // default test
- testSubject = createTestSubject();
- testSubject.setId(id);
- }
-
- @Test
- public void testGetAppId() throws Exception {
- CategoryParameterOption testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getAppId();
- }
-
- @Test
- public void testSetAppId() throws Exception {
- CategoryParameterOption testSubject;
- String appId = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setAppId(appId);
- }
-
- @Test
- public void testGetName() throws Exception {
- CategoryParameterOption testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getName();
- }
-
- @Test
- public void testSetName() throws Exception {
- CategoryParameterOption testSubject;
- String name = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setName(name);
- }
-
- @Test
- public void testGetCategoryParameter() throws Exception {
- CategoryParameterOption testSubject;
- CategoryParameter result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getCategoryParameter();
- }
-
- @Test
- public void testSetCategoryParameter() throws Exception {
- CategoryParameterOption testSubject;
- CategoryParameter categoryParameter = null;
-
- // default test
- testSubject = createTestSubject();
- testSubject.setCategoryParameter(categoryParameter);
- }
-
- @Test
- public void testGetCreated() throws Exception {
- CategoryParameterOption testSubject;
- Date result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getCreated();
- }
-
- @Test
- public void testGetModified() throws Exception {
- CategoryParameterOption testSubject;
- Date result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getModified();
- }
-
- @Test
- public void testGetCreatedId() throws Exception {
- CategoryParameterOption testSubject;
- Long result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getCreatedId();
- }
+ final private String[] excludedProperties = TestUtils.allPropertiesOf(DomainVo.class);
@Test
- public void testGetModifiedId() throws Exception {
- CategoryParameterOption testSubject;
- Long result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getModifiedId();
- }
-
- @Test
- public void testGetAuditUserId() throws Exception {
- CategoryParameterOption testSubject;
- Serializable result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getAuditUserId();
+ public void shouldHaveValidGettersAndSetters() {
+ assertThat(CategoryParameterOption.class, hasValidGettersAndSetters());
}
@Test
- public void testGetRowNum() throws Exception {
- CategoryParameterOption testSubject;
- Long result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getRowNum();
+ public void shouldHaveValidBeanHashCode() {
+ assertThat(CategoryParameterOption.class,
+ hasValidBeanHashCodeExcluding(ArrayUtils.addAll(new String[]{"categoryParameter"}, excludedProperties)));
}
@Test
- public void testGetAuditTrail() throws Exception {
- CategoryParameterOption testSubject;
- Set result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getAuditTrail();
- }
-
- @Test
- public void testEquals() throws Exception {
- CategoryParameterOption testSubject;
- Object o = null;
- boolean result;
-
- // test 1
- testSubject = createTestSubject();
- o = null;
- result = testSubject.equals(o);
- Assert.assertEquals(false, result);
- }
-
- @Test
- public void testHashCode() throws Exception {
- CategoryParameterOption testSubject;
- int result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.hashCode();
+ public void shouldHaveValidBeanEquals() {
+ assertThat(CategoryParameterOption.class, hasValidBeanEqualsExcluding(excludedProperties));
}
}