summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshrek2000 <oren.kleks@amdocs.com>2019-11-28 10:53:50 +0200
committerOren Kleks <oren.kleks@amdocs.com>2019-11-28 09:32:47 +0000
commitac3b789c707846274a155e123c8f2de695bd22bb (patch)
treee74ccee39ddea6f2ecfb4f8db799429a8d9a0093
parentc49ad1c995d0cf58ce4a1a99ad635ecc29f8b2a9 (diff)
Fix Sonar issues
lombok helps to increase code coverage Issue-ID: SDC-2690 Signed-off-by: shrek2000 <oren.kleks@amdocs.com> Change-Id: I076c200befe2c1c887db81fe6db8e00af3556f36
-rw-r--r--security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java34
1 files changed, 4 insertions, 30 deletions
diff --git a/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java b/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java
index 9440eea..b8f3afa 100644
--- a/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java
+++ b/security-util-lib/src/main/java/org/onap/sdc/security/AuthenticationCookie.java
@@ -21,9 +21,13 @@
package org.onap.sdc.security;
import java.util.Set;
+import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
+import lombok.ToString;
+@EqualsAndHashCode
+@ToString
public class AuthenticationCookie {
@Getter @Setter
@@ -72,35 +76,5 @@ public class AuthenticationCookie {
this.lastName = lastName;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof AuthenticationCookie)) return false;
- AuthenticationCookie that = (AuthenticationCookie) o;
-
- if (getMaxSessionTime() != that.getMaxSessionTime()) return false;
- if (getCurrentSessionTime() != that.getCurrentSessionTime()) return false;
- if (getUserID() != null ? !getUserID().equals(that.getUserID()) : that.getUserID() != null) return false;
- return getRoles() != null ? getRoles().containsAll(that.getRoles()) : that.getRoles() == null;
- }
-
- @Override
- public int hashCode() {
- int result = getUserID() != null ? getUserID().hashCode() : 0;
- result = 31 * result + (getRoles() != null ? getRoles().hashCode() : 0);
- result = 31 * result + (int) (getMaxSessionTime() ^ (getMaxSessionTime() >>> 32));
- result = 31 * result + (int) (getCurrentSessionTime() ^ (getCurrentSessionTime() >>> 32));
- return result;
- }
-
- @Override
- public String toString() {
- return "AuthenticationCookie{" +
- "userID='" + userID + '\'' +
- ", roles=" + roles +
- ", maxSessionTime=" + maxSessionTime +
- ", currentSessionTime=" + currentSessionTime +
- '}';
- }
}