diff options
Diffstat (limited to 'appc-dispatcher/appc-request-handler/appc-request-handler-core')
4 files changed, 11 insertions, 20 deletions
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/RequestHandlerImpl.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/RequestHandlerImpl.java index b1fe117b7..07a430671 100644 --- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/RequestHandlerImpl.java +++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/openecomp/appc/requesthandler/impl/RequestHandlerImpl.java @@ -29,7 +29,6 @@ import org.openecomp.appc.domainmodel.lcm.*; import org.openecomp.appc.exceptions.APPCException; import org.openecomp.appc.executor.CommandExecutor; import org.openecomp.appc.executor.UnstableVNFException; -import org.openecomp.appc.executor.objects.CommandExecutorInput; import org.openecomp.appc.executor.objects.LCMCommandStatus; import org.openecomp.appc.executor.objects.Params; import org.openecomp.appc.executor.objects.UniqueRequestIdentifier; @@ -368,9 +367,7 @@ public class RequestHandlerImpl implements RequestHandler { logger.debug("Calling command Executor with remaining TTL value: " + remainingTTL); } - RuntimeContext clonedContext = cloneContext(runtimeContext); - - CommandExecutorInput commandExecutorInput = new CommandExecutorInput(clonedContext, remainingTTL); + RuntimeContext commandExecutorInput = cloneContext(runtimeContext); try { commandExecutor.executeCommand(commandExecutorInput); 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 e060775ce..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,9 +28,9 @@ 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.CommandExecutorInput; import org.openecomp.appc.executor.objects.LCMCommandStatus; import org.openecomp.appc.lifecyclemanager.LifecycleManager; import org.openecomp.appc.lifecyclemanager.objects.LifecycleException; @@ -400,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()); @@ -435,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; @@ -552,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(); @@ -565,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; } |