From af0fbf9edb92544380d40ab2cffb87c89831944f Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Mon, 18 Sep 2017 11:10:02 +0200 Subject: Add new tests to CLAMP New tests added on ModelProperties, CldsModel and ITs (CldsService tests) Change-Id: I75a29c11ec66e0eef7c80f76cf90c30b2fc29972 Issue-ID: CLAMP-54 Signed-off-by: Determe, Sebastien (sd378r) --- src/main/java/org/onap/clamp/clds/model/CldsModel.java | 6 ++++-- .../org/onap/clamp/clds/service/DefaultUserNameHandler.java | 3 --- .../java/org/onap/clamp/clds/service/SecureServiceBase.java | 11 ++++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModel.java b/src/main/java/org/onap/clamp/clds/model/CldsModel.java index 7eac3d92a..62b10d44f 100644 --- a/src/main/java/org/onap/clamp/clds/model/CldsModel.java +++ b/src/main/java/org/onap/clamp/clds/model/CldsModel.java @@ -116,7 +116,7 @@ public class CldsModel { public boolean canInventoryCall() { boolean canCall = false; - /* Below checks the clds ecent is submit/resubmit */ + /* Below checks the clds event is submit/resubmit */ if ((event.isActionCd(CldsEvent.ACTION_SUBMIT) || event.isActionCd(CldsEvent.ACTION_RESUBMIT))) { canCall = true; @@ -225,7 +225,9 @@ public class CldsModel { /** * Determine permittedActionCd list using the actionCd from the current - * event. + * event. It's a states graph, given the next action that can be executed + * from the one that has been executed (described in the event object). + * ACTION_CREATE being the first one. */ private void determinePermittedActionCd() { String actionCd = getCurrentActionCd(); diff --git a/src/main/java/org/onap/clamp/clds/service/DefaultUserNameHandler.java b/src/main/java/org/onap/clamp/clds/service/DefaultUserNameHandler.java index 511cafe1e..574689e5b 100644 --- a/src/main/java/org/onap/clamp/clds/service/DefaultUserNameHandler.java +++ b/src/main/java/org/onap/clamp/clds/service/DefaultUserNameHandler.java @@ -29,9 +29,6 @@ import javax.ws.rs.core.SecurityContext; public class DefaultUserNameHandler implements UserNameHandler { - public DefaultUserNameHandler() { - } - /* * (non-Javadoc) * diff --git a/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java b/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java index 19813ebaf..acbd8bbd4 100644 --- a/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java +++ b/src/main/java/org/onap/clamp/clds/service/SecureServiceBase.java @@ -23,6 +23,9 @@ package org.onap.clamp.clds.service; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + import java.security.Principal; import javax.ws.rs.NotAuthorizedException; @@ -31,9 +34,6 @@ import javax.ws.rs.core.SecurityContext; import org.onap.clamp.clds.util.LoggingUtils; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; - /** * Base/abstract Service class. Implements shared security methods. */ @@ -185,4 +185,9 @@ public abstract class SecureServiceBase { userNameHandler = handler; } } + + public void setSecurityContext(SecurityContext securityContext) { + this.securityContext = securityContext; + } + } -- cgit 1.2.3-korg