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