diff options
author | 2017-04-21 10:22:36 -0700 | |
---|---|---|
committer | 2017-04-21 11:08:06 -0700 | |
commit | 8b8b54c7ace5d58e4d12b47a7b6fad67c56507a1 (patch) | |
tree | 06ae3646263d98c6835b32254a00c5e6e898d898 /appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test | |
parent | 1c01a49fd2ea437587661feb70003c1025163328 (diff) |
Remove CommandRequest and subclasses
From the last refactoring, CommandRequest ended up
containing only a single CommandExecutorInput value.
This change removes CommandRequest and subclasses and
replaces their use with CommandExecutorInput directly
The type parameter on CommandTask is also removed
accordingly.
Change-Id: I867df65f344fa58698a44c4b20815dbce382ad55
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test')
-rw-r--r-- | appc-dispatcher/appc-command-executor/appc-command-executor-core/src/test/java/org/openecomp/appc/executor/TestCommandExecutionTask.java | 28 |
1 files changed, 9 insertions, 19 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 1e46393d3..ca6694064 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 @@ -35,9 +35,6 @@ import org.openecomp.appc.executor.impl.CommandTask; import org.openecomp.appc.executor.impl.CommandTaskFactory; import org.openecomp.appc.executor.impl.LCMCommandTask; import org.openecomp.appc.executor.impl.LCMReadonlyCommandTask; -import org.openecomp.appc.executor.impl.objects.CommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMCommandRequest; -import org.openecomp.appc.executor.impl.objects.LCMReadOnlyCommandRequest; import org.openecomp.appc.executor.objects.*; import org.openecomp.appc.lifecyclemanager.LifecycleManager; import org.openecomp.appc.requesthandler.RequestHandler; @@ -132,7 +129,7 @@ public class TestCommandExecutionTask { @Test public void testFactory(){ - CommandTask<? extends CommandRequest> task = factory.getExecutionTask("Configure"); + CommandTask task = factory.getExecutionTask("Configure"); assertEquals(LCMCommandTask.class,task.getClass() ); task = factory.getExecutionTask("Sync"); assertEquals(LCMReadonlyCommandTask.class,task.getClass() ); @@ -144,28 +141,28 @@ public class TestCommandExecutionTask { @Test public void testOnRequestCompletion(){ Mockito.doNothing().when(requestHandler).onRequestTTLEnd((RuntimeContext) anyObject(),anyBoolean()); - LCMCommandRequest request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"), VNFOperation.Configure, "1", "1.0"); + CommandExecutorInput request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"), VNFOperation.Configure, "1", "1.0"); CommandResponse response = getCommandResponse(VNFOperation.Configure, true, "11", "","1"); executionTask.onRequestCompletion(request, response); } @Test public void testRunGetConfig(){ - LCMReadOnlyCommandRequest request = getConfigCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); + CommandExecutorInput request = getConfigCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); LCMReadonlyCommandTask.setCommandRequest(request); LCMReadonlyCommandTask.run(); } @Test public void testRun(){ - LCMCommandRequest request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); + CommandExecutorInput request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); executionTask.setCommandRequest(request); executionTask.run(); } @Test public void testRunNegative(){ - LCMCommandRequest request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); + CommandExecutorInput request = getLCMCommandRequest("FIREWALL",30,new Date(), "11" ,setTTLInFlags("30"),VNFOperation.Sync, "1", "1.0"); executionTask.setCommandRequest(request); executionTask.run(); } @@ -208,7 +205,6 @@ public class TestCommandExecutionTask { String requestId = "1"; CommandExecutorInput commandExecutorInput = pouplateCommandExecutorInput("FIREWALL",30, "1.0", timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", VNFOperation.Configure, "33", ""); - CommandRequest request = new CommandRequest(commandExecutorInput); } @@ -221,22 +217,16 @@ public class TestCommandExecutionTask { } - private LCMReadOnlyCommandRequest getConfigCommandRequest(String vnfType , Integer ttl , Date timeStamp, String requestId, + private CommandExecutorInput getConfigCommandRequest(String vnfType , Integer ttl , Date timeStamp, String requestId, Map<String,Object> flags, VNFOperation command , String vnfId, String vnfVersion ){ - CommandExecutorInput commandExecutorInput = pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); - LCMReadOnlyCommandRequest request = new LCMReadOnlyCommandRequest(commandExecutorInput); - - return request; + return pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); } - private LCMCommandRequest getLCMCommandRequest(String vnfType , Integer ttl ,Date timeStamp, String requestId, + private CommandExecutorInput getLCMCommandRequest(String vnfType , Integer ttl ,Date timeStamp, String requestId, Map<String,Object> flags, VNFOperation command , String vnfId, String vnfVersion ){ - CommandExecutorInput commandExecutorInput = pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); - LCMCommandRequest request = new LCMCommandRequest(commandExecutorInput); - - return request; + return pouplateCommandExecutorInput(vnfType, ttl, vnfVersion, timeStamp, API_VERSION, requestId, ORIGINATOR_ID, "", command, vnfId, ""); } public WorkflowResponse getWorkflowResponse (){ |