From 3bdedab365bf7dbc2288c988e24a97ed4823d864 Mon Sep 17 00:00:00 2001 From: Tomasz Golabek Date: Thu, 22 Aug 2019 11:21:04 +0200 Subject: unit tests - catalog-model Additional junit tests Change-Id: I9952933895ba22114fb0bf19a51e54f1a232c8f3 Issue-ID: SDC-2326 Signed-off-by: Tomasz Golabek --- .../elements/ConsumerDataDefinitionTest.java | 170 +-------------------- 1 file changed, 7 insertions(+), 163 deletions(-) (limited to 'common-be/src/test') diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinitionTest.java index 4780c4753f..ddcb32f87a 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinitionTest.java @@ -17,13 +17,15 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.datatypes.elements; +import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSetters; +import static com.google.code.beanmatchers.BeanMatchers.hasValidGettersAndSettersExcluding; +import static org.junit.Assert.assertThat; + import org.junit.Assert; import org.junit.Test; - public class ConsumerDataDefinitionTest { private ConsumerDataDefinition createTestSubject() { @@ -31,168 +33,10 @@ public class ConsumerDataDefinitionTest { } @Test - public void testCopyConstructor() throws Exception { - ConsumerDataDefinition testSubject; - String result; - - // default test - testSubject = createTestSubject(); - new ConsumerDataDefinition(testSubject); - } - - @Test - public void testGetConsumerName() throws Exception { - ConsumerDataDefinition testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getConsumerName(); - } - - - @Test - public void testSetConsumerName() throws Exception { - ConsumerDataDefinition testSubject; - String consumerName = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setConsumerName(consumerName); - } - - - @Test - public void testGetConsumerPassword() throws Exception { - ConsumerDataDefinition testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getConsumerPassword(); - } - - - @Test - public void testSetConsumerPassword() throws Exception { - ConsumerDataDefinition testSubject; - String consumerPassword = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setConsumerPassword(consumerPassword); - } - - - @Test - public void testGetConsumerSalt() throws Exception { - ConsumerDataDefinition testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getConsumerSalt(); - } - - - @Test - public void testSetConsumerSalt() throws Exception { - ConsumerDataDefinition testSubject; - String consumerSalt = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setConsumerSalt(consumerSalt); - } - - - @Test - public void testGetConsumerLastAuthenticationTime() throws Exception { - ConsumerDataDefinition testSubject; - Long result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getConsumerLastAuthenticationTime(); - } - - - @Test - public void testSetConsumerLastAuthenticationTime() throws Exception { - ConsumerDataDefinition testSubject; - Long consumerLastAuthenticationTime = null; - - // default test - testSubject = createTestSubject(); - testSubject.setConsumerLastAuthenticationTime(consumerLastAuthenticationTime); - } - - - @Test - public void testGetConsumerDetailsLastupdatedtime() throws Exception { - ConsumerDataDefinition testSubject; - Long result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getConsumerDetailsLastupdatedtime(); - } - - - @Test - public void testSetConsumerDetailsLastupdatedtime() throws Exception { - ConsumerDataDefinition testSubject; - Long consumerDetailsLastupdatedtime = null; - - // default test - testSubject = createTestSubject(); - testSubject.setConsumerDetailsLastupdatedtime(consumerDetailsLastupdatedtime); - } - - - @Test - public void testGetLastModfierAtuid() throws Exception { - ConsumerDataDefinition testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getLastModfierAtuid(); - } - - - @Test - public void testSetLastModfierAtuid() throws Exception { - ConsumerDataDefinition testSubject; - String lastModfierAtuid = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setLastModfierAtuid(lastModfierAtuid); - } - - - @Test - public void testToString() throws Exception { - ConsumerDataDefinition testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.toString(); + public void shouldHaveValidGettersAndSetters() { + assertThat(ConsumerDataDefinition.class, + hasValidGettersAndSettersExcluding("empty", "ownerIdIfEmpty", "type", "version")); } - - - @Test - public void testHashCode() throws Exception { - ConsumerDataDefinition testSubject; - int result; - - // default test - testSubject = createTestSubject(); - result = testSubject.hashCode(); - } - @Test public void testEquals() throws Exception { -- cgit 1.2.3-korg