diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2017-04-21 12:34:25 -0700 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2017-05-01 10:58:52 -0700 |
commit | fa68917a405125b75c6b23ca68310aab8c94a79a (patch) | |
tree | e9ed20f26647d1be5c308e772a223d9ab8500116 /appc-dispatcher/appc-command-executor/appc-command-executor-core | |
parent | 14365b73fbf5111e62ba91b9d7f80602db383a3c (diff) |
Make Flags immutable
Change-Id: Ib2e06d41d4e1eb6fb40144258067d2c71ac1d620
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-core')
2 files changed, 9 insertions, 11 deletions
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutionTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutionTask.java index 97d77a9d8..9757430d8 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutionTask.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutionTask.java @@ -31,6 +31,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.impl.CommandTask; import org.openecomp.appc.executor.impl.CommandTaskFactory; import org.openecomp.appc.executor.impl.LCMCommandTask; @@ -179,8 +180,7 @@ public class TestCommandExecutionTask { CommonHeader commonHeader = new CommonHeader(); requestContext.setCommonHeader(commonHeader); responseContext.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(); @@ -232,7 +232,7 @@ public class TestCommandExecutionTask { ResponseContext responseContext = createResponseContextWithSuObjects(); commandExecutorInput.setResponseContext(responseContext); - requestContext.getCommonHeader().getFlags().setTtl(ttl); + requestContext.getCommonHeader().setFlags(new Flags(null, false, ttl)); requestContext.getCommonHeader().setApiVer(apiVersion); requestContext.getCommonHeader().setTimestamp(timeStamp); requestContext.getCommonHeader().setRequestId(requestId); @@ -258,8 +258,7 @@ public class TestCommandExecutionTask { runtimeContext.setRequestContext(requestContext); 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(); @@ -271,10 +270,9 @@ public class TestCommandExecutionTask { 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-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutor.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutor.java index ba4221509..bb4e39109 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutor.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutor.java @@ -30,6 +30,7 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import org.openecomp.appc.domainmodel.lcm.*; +import org.openecomp.appc.domainmodel.lcm.Flags.Mode; import org.openecomp.appc.exceptions.APPCException; import org.openecomp.appc.executionqueue.ExecutionQueueService; import org.openecomp.appc.executor.impl.CommandExecutorImpl; @@ -114,9 +115,9 @@ public class TestCommandExecutor { private RuntimeContext pouplateCommandExecutorInput(String vnfType, int ttl, String vnfVersion, Date timeStamp, String apiVersion, String requestId, String originatorID, String subRequestID, VNFOperation action, String vnfId , String payload){ - RuntimeContext commandExecutorInput = createCommandExecutorInputWithSubObjects(); + RuntimeContext commandExecutorInput = createCommandExecutorInputWithSubObjects(); RequestContext requestContext = commandExecutorInput.getRequestContext(); - requestContext.getCommonHeader().getFlags().setTtl(ttl); + requestContext.getCommonHeader().setFlags(new Flags(null, false, ttl)); requestContext.getCommonHeader().setApiVer(apiVersion); requestContext.getCommonHeader().setTimestamp(timeStamp); requestContext.getCommonHeader().setRequestId(requestId); @@ -138,8 +139,7 @@ public class TestCommandExecutor { runtimeContext.setRequestContext(requestContext); 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(); |