73d50a5db4c904069129b9962c1076a40de20c1d
[policy/drools-applications.git] /
1 package org.onap.policy.template.demo;
2
3 import static org.junit.Assert.assertNotNull;
4 import static org.junit.Assert.fail;
5
6 import java.util.UUID;
7
8 import org.junit.AfterClass;
9 import org.junit.BeforeClass;
10 import org.junit.Ignore;
11 import org.junit.Test;
12 import org.onap.policy.aai.AAIGETResponse;
13 import org.onap.policy.aai.AAINQF199.AAINQF199Manager;
14 import org.onap.policy.aai.AAINQF199.AAINQF199Request;
15 import org.onap.policy.aai.AAINQF199.AAINQF199Response;
16 import org.onap.policy.drools.http.server.HttpServletServer;
17
18 public class AaiSimulatorTest {
19         
20         @BeforeClass
21         public static void setUpSimulator() {
22                 try {
23                         Util.buildAaiSim();
24                 } catch (InterruptedException e) {
25                         fail(e.getMessage());
26                 }
27         }
28         
29         @AfterClass
30         public static void tearDownSimulator() {
31                 HttpServletServer.factory.destroy();
32         }
33         
34         @Test
35         public void testGet() {
36                 AAIGETResponse response = AAINQF199Manager.getQuery("http://localhost:6666", "testUser", "testPass", UUID.randomUUID(), "5e49ca06-2972-4532-9ed4-6d071588d792");
37                 assertNotNull(response);
38                 assertNotNull(response.relationshipList);
39         }
40
41         @Test
42         public void testPost() {
43                 AAINQF199Response response = AAINQF199Manager.postQuery("http://localhost:6666", "testUser", "testPass", new AAINQF199Request(), UUID.randomUUID());
44                 assertNotNull(response);
45                 assertNotNull(response.inventoryResponseItems);
46         }
47 }