1 package org.openecomp.mso.client.appc;
\r
3 import static org.junit.Assert.assertEquals;
\r
5 import java.util.Properties;
\r
6 import java.util.UUID;
\r
8 import org.junit.AfterClass;
\r
9 import org.junit.BeforeClass;
\r
10 import org.junit.Ignore;
\r
11 import org.junit.Test;
\r
13 import org.openecomp.appc.client.lcm.model.Action;
\r
14 import org.openecomp.appc.client.lcm.model.ActionIdentifiers;
\r
15 import org.openecomp.appc.client.lcm.model.CheckLockInput;
\r
16 import org.openecomp.appc.client.lcm.model.Flags;
\r
17 import org.openecomp.appc.client.lcm.model.Status;
\r
19 public class ApplicationControllerClientTest {
\r
21 private static ApplicationControllerClient client;
\r
22 private static ApplicationControllerSupport support;
\r
25 public static void beforeClass() {
\r
26 client = new ApplicationControllerClient();
\r
27 support = new ApplicationControllerSupport();
\r
28 client.appCSupport = support;
\r
29 System.setProperty("mso.config.path", "src/test/resources");
\r
34 public static void afterClass() throws Exception {
\r
35 client.shutdownclient();
\r
39 @Ignore // IGNORED FOR 1710 MERGE TO ONAP
\r
40 public void createRequest_CheckLock_RequestBuilt() throws Exception {
\r
42 org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
\r
43 "org.openecomp.appc.client.lcm.model");
\r
44 Flags flags = new Flags();
\r
45 ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
\r
46 actionIdentifiers.setVnfId("vnfId");
\r
47 CheckLockInput checkLockInput = (CheckLockInput) client.createRequest(Action.CheckLock, actionIdentifiers,
\r
48 flags, null, "requestId");
\r
49 assertEquals(checkLockInput.getAction().name(), "CheckLock");
\r
53 @Ignore // IGNORED FOR 1710 MERGE TO ONAP
\r
54 public void runCommand_liveAppc() throws Exception {
\r
55 org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
\r
56 "org.openecomp.appc.client.lcm.model");
\r
57 Flags flags = new Flags();
\r
58 ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
\r
59 actionIdentifiers.setVnfId("ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f");
\r
61 // CheckLockInput checkLockInput = (CheckLockInput)
\r
62 // client.createRequest(Action.CheckLock,actionIdentifiers,flags,null,"requestId");
\r
63 Status status = client.runCommand(Action.Lock, actionIdentifiers, flags, null, UUID.randomUUID().toString());
\r
64 assertEquals("Status of run command is correct", status.getCode(), 306);
\r
68 @Ignore // IGNORED FOR 1710 MERGE TO ONAP
\r
69 public void runCommand_CheckLock_RequestBuilt() throws Exception {
\r
70 org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
\r
71 "org.openecomp.appc.client.lcm.model");
\r
72 Flags flags = new Flags();
\r
73 ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
\r
74 actionIdentifiers.setVnfId("fusion-vpp-vnf-001");
\r
75 Status status = client.runCommand(Action.CheckLock, actionIdentifiers, flags, null, "requestId");
\r
76 assertEquals("Status of run command is correct", status.getCode(), 400);
\r