aboutsummaryrefslogtreecommitdiffstats
path: root/common-be
diff options
context:
space:
mode:
authorTomasz Golabek <tomasz.golabek@nokia.com>2019-08-22 11:21:04 +0200
committerPiotr Darosz <piotr.darosz@nokia.com>2019-08-22 11:10:26 +0000
commit3bdedab365bf7dbc2288c988e24a97ed4823d864 (patch)
treeb728cf08a8bc3aabd3e255811021b6de26539837 /common-be
parente558a6469df40ba7c7aca8cdf81cacd703cd4b0b (diff)
unit tests - catalog-model
Additional junit tests Change-Id: I9952933895ba22114fb0bf19a51e54f1a232c8f3 Issue-ID: SDC-2326 Signed-off-by: Tomasz Golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'common-be')
-rw-r--r--common-be/pom.xml6
-rw-r--r--common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/ConsumerDataDefinitionTest.java170
2 files changed, 13 insertions, 163 deletions
diff --git a/common-be/pom.xml b/common-be/pom.xml
index baefbc9f9f..b8365ff990 100644
--- a/common-be/pom.xml
+++ b/common-be/pom.xml
@@ -76,6 +76,12 @@
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.google.code.bean-matchers</groupId>
+ <artifactId>bean-matchers</artifactId>
+ <version>${bean-matchers.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
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 {