summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src
diff options
context:
space:
mode:
authorManoop Talasila <talasila@research.att.com>2018-10-09 19:27:44 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-09 19:27:44 +0000
commit27ee88a33231af6410b3c1e49bba83c556914a30 (patch)
treeda783b5626d9d7468d4bff89beedbce104b688bd /ecomp-portal-BE-common/src
parent71c3cf6ce33b14c0b19891979e4e2aad0452ff4e (diff)
parent0a8d7bcce19974bf63c024a030d3a5494f61d283 (diff)
Merge "test cases for the remaining lines of equal method"
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r--ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/BEPropertyTest.java60
1 files changed, 39 insertions, 21 deletions
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/BEPropertyTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/BEPropertyTest.java
index 102e6aeb..516393a3 100644
--- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/BEPropertyTest.java
+++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/BEPropertyTest.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ================================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -45,25 +47,41 @@ import org.junit.Test;
public class BEPropertyTest {
-
- private static final String TEST="test";
-
- @Test
- public void test() {
- BEProperty property=new BEProperty(TEST, TEST);
- BEProperty beProperty=new BEProperty(TEST, TEST);
- BEProperty be=property;
-
- beProperty.setKey(property.getKey());
- beProperty.setValue(property.getValue());
-
- assertEquals(property.hashCode(), beProperty.hashCode());
- assertTrue(beProperty.equals(property));
- assertTrue(be.equals(property));
- assertFalse(be.equals(null));
- be.setValue(null);
- assertTrue(be.equals(property));
- be.setKey(null);
- assertTrue(be.equals(property));
- }
+
+ private static final String TEST="test";
+
+ @Test
+ public void test() {
+ BEProperty property=new BEProperty(TEST, TEST);
+ BEProperty beProperty=new BEProperty(TEST, TEST);
+ BEProperty be=property;
+
+ beProperty.setKey(property.getKey());
+ beProperty.setValue(property.getValue());
+
+ assertEquals(property.hashCode(), beProperty.hashCode());
+ assertTrue(beProperty.equals(property));
+ assertTrue(be.equals(property));
+ assertFalse(be.equals(null));
+ be.setValue(null);
+ assertTrue(be.equals(property));
+ be.setKey(null);
+ assertTrue(be.equals(property));
+
+ assertFalse(property.equals(this));
+
+ property.setKey(null);
+ beProperty.setKey("notnull");
+ assertFalse(property.equals(beProperty));
+ assertFalse(beProperty.equals(property));
+
+ property.setKey("notnull");
+ beProperty.setKey("notnull");
+ property.setValue(null);
+ beProperty.setValue("notnull");
+ assertFalse(property.equals(beProperty));
+ assertFalse(beProperty.equals(property));
+
+
+ }
}