8d3fd5d3a181b99d1a9a5380efe65b56d3766a53
[sdc/sdc-workflow-designer.git] /
1 /**\r
2  * Copyright (c) 2018 ZTE Corporation.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the Apache License, Version 2.0\r
5  * and the Eclipse Public License v1.0 which both accompany this distribution,\r
6  * and are available at http://www.eclipse.org/legal/epl-v10.html\r
7  * and http://www.apache.org/licenses/LICENSE-2.0\r
8  *\r
9  * Contributors:\r
10  *     ZTE - initial API and implementation and/or initial documentation\r
11  */\r
12 package org.onap.sdc.workflowdesigner.resources;\r
13 \r
14 import static org.junit.Assert.assertEquals;\r
15 \r
16 import javax.ws.rs.core.Response;\r
17 \r
18 import org.junit.After;\r
19 import org.junit.Before;\r
20 import org.junit.Test;\r
21 import org.onap.sdc.workflowdesigner.resources.entity.ExtendActivity;\r
22 import org.onap.sdc.workflowdesigner.utils.FileCommonUtils;\r
23 \r
24 import com.google.gson.Gson;\r
25 \r
26 /**\r
27  *\r
28  */\r
29 public class ExtendActivityResourceTest {\r
30 \r
31   /**\r
32    * @throws java.lang.Exception\r
33    */\r
34   @Before\r
35   public void setUp() throws Exception {}\r
36 \r
37   /**\r
38    * @throws java.lang.Exception\r
39    */\r
40   @After\r
41   public void tearDown() throws Exception {}\r
42 \r
43   /**\r
44    * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#getExtActivities(java.lang.String)}.\r
45    */\r
46   @Test\r
47   public void testGetExtActivities() {\r
48     ExtendActivityResource resource = new ExtendActivityResource();\r
49     try {\r
50       Response response = resource.getExtActivities("test");\r
51       ExtendActivity[] extActivities = (ExtendActivity[]) response.getEntity();\r
52       Gson gson = new Gson();\r
53       FileCommonUtils.write("test.json", gson.toJson(extActivities));\r
54       assertEquals(extActivities.length == 0, false);\r
55     } catch (Exception e) {\r
56       e.printStackTrace();\r
57     }\r
58 \r
59   }\r
60 \r
61   /**\r
62    * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#getDisplayInfo(java.lang.String)}.\r
63    */\r
64   @Test\r
65   public void testGetDisplayInfo() {\r
66 \r
67   }\r
68 \r
69 }\r