summaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-request-handler
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-04-21 12:34:25 -0700
committerPatrick Brady <pb071s@att.com>2017-05-01 10:58:52 -0700
commitfa68917a405125b75c6b23ca68310aab8c94a79a (patch)
treee9ed20f26647d1be5c308e772a223d9ab8500116 /appc-dispatcher/appc-request-handler
parent14365b73fbf5111e62ba91b9d7f80602db383a3c (diff)
Make Flags immutable
Change-Id: Ib2e06d41d4e1eb6fb40144258067d2c71ac1d620 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'appc-dispatcher/appc-request-handler')
-rw-r--r--appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestConverter.java3
-rw-r--r--appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestHandler.java12
-rw-r--r--appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestValidator.java10
3 files changed, 10 insertions, 15 deletions
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestConverter.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestConverter.java
index aaf17fba9..87fda3930 100644
--- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestConverter.java
+++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestConverter.java
@@ -337,10 +337,9 @@ public class TestConverter {
ResponseContext responseContext = new ResponseContext();
CommonHeader commonHeader = new CommonHeader();
- Flags flags = new Flags();
responseContext.setCommonHeader(commonHeader);
responseContext.setStatus(new Status(0, null));
- commonHeader.setFlags(flags);
+ commonHeader.setFlags(new Flags(null, false, 0));
return responseContext;
}
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestHandler.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestHandler.java
index e1c117fe3..0c7ded71a 100644
--- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestHandler.java
+++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestHandler.java
@@ -28,6 +28,7 @@ import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mockito;
import org.openecomp.appc.domainmodel.lcm.*;
+import org.openecomp.appc.domainmodel.lcm.Flags.Mode;
import org.openecomp.appc.executor.CommandExecutor;
import org.openecomp.appc.executor.UnstableVNFException;
import org.openecomp.appc.executor.objects.LCMCommandStatus;
@@ -399,7 +400,7 @@ public class TestRequestHandler {
requestHandler.onRequestTTLEnd(response,true);
input1 = this.getRequestHandlerInput("138", VNFOperation.Configure, 1200,
false,UUID.randomUUID().toString(),UUID.randomUUID().toString(),UUID.randomUUID().toString(),new Date());
- input1.getRequestContext().getCommonHeader().getFlags().setForce(true);
+ input1.getRequestContext().getCommonHeader().setFlags(new Flags(null, true, 1200));
mockRuntimeContextAndVnfContext(input1);
output = requestHandler.handleRequest(input1);
Assert.assertEquals(LCMCommandStatus.ACCEPTED.getResponseCode(),output.getResponseContext().getStatus().getCode());
@@ -434,8 +435,7 @@ public class TestRequestHandler {
requestContext.getCommonHeader().setRequestId(requestId);
requestContext.getCommonHeader().setSubRequestId(subRequestId);
requestContext.getCommonHeader().setOriginatorId(originatorId);
- requestContext.getCommonHeader().getFlags().setTtl(ttl);
- requestContext.getCommonHeader().getFlags().setForce(force);
+ requestContext.getCommonHeader().setFlags(new Flags(null, force, ttl));
requestContext.getCommonHeader().setTimestamp(timeStamp);
requestContext.getCommonHeader().setApiVer(API_VERSION);
return input;
@@ -551,8 +551,7 @@ public class TestRequestHandler {
runtimeContext.setResponseContext(responseContext);
CommonHeader commonHeader = new CommonHeader();
requestContext.setCommonHeader(commonHeader);
- Flags flags = new Flags();
- commonHeader.setFlags(flags);
+ commonHeader.setFlags(new Flags(null, false, 0));
ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
requestContext.setActionIdentifiers(actionIdentifiers);
VNFContext vnfContext = new VNFContext();
@@ -564,10 +563,9 @@ public class TestRequestHandler {
private ResponseContext createResponseContextWithSuObjects(){
ResponseContext responseContext = new ResponseContext();
CommonHeader commonHeader = new CommonHeader();
- Flags flags = new Flags();
responseContext.setCommonHeader(commonHeader);
responseContext.setStatus(new Status(0, null));
- commonHeader.setFlags(flags);
+ commonHeader.setFlags(new Flags(null, false, 0));
return responseContext;
}
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestValidator.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestValidator.java
index becd95d46..1298aa542 100644
--- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestValidator.java
+++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/test/java/org/openecomp/appc/requesthandler/TestRequestValidator.java
@@ -30,6 +30,7 @@ import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.openecomp.appc.domainmodel.lcm.*;
+import org.openecomp.appc.domainmodel.lcm.Flags.Mode;
import org.openecomp.appc.executor.UnstableVNFException;
import org.openecomp.appc.lifecyclemanager.LifecycleManager;
import org.openecomp.appc.lifecyclemanager.objects.LifecycleException;
@@ -230,8 +231,7 @@ public class TestRequestValidator {
requestContext.getCommonHeader().setRequestId(requestId);
requestContext.getCommonHeader().setSubRequestId(subRequestId);
requestContext.getCommonHeader().setOriginatorId(originatorId);
- requestContext.getCommonHeader().getFlags().setTtl(ttl);
- requestContext.getCommonHeader().getFlags().setForce(force);
+ requestContext.getCommonHeader().setFlags(new Flags(null, force, ttl));
requestContext.getCommonHeader().getTimeStamp();
requestContext.getCommonHeader().setApiVer(API_VERSION);
requestContext.getCommonHeader().setTimestamp(timeStamp);
@@ -587,8 +587,7 @@ public class TestRequestValidator {
runtimeContext.setResponseContext(responseContext);
CommonHeader commonHeader = new CommonHeader();
requestContext.setCommonHeader(commonHeader);
- Flags flags = new Flags();
- commonHeader.setFlags(flags);
+ commonHeader.setFlags(new Flags(null, false, 0));
ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
requestContext.setActionIdentifiers(actionIdentifiers);
VNFContext vnfContext = new VNFContext();
@@ -600,10 +599,9 @@ public class TestRequestValidator {
private ResponseContext createResponseContextWithSuObjects(){
ResponseContext responseContext = new ResponseContext();
CommonHeader commonHeader = new CommonHeader();
- Flags flags = new Flags();
responseContext.setCommonHeader(commonHeader);
responseContext.setStatus(new Status(0, null));
- commonHeader.setFlags(flags);
+ commonHeader.setFlags(new Flags(null, false, 0));
return responseContext;
}