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
10 * ZTE - initial API and implementation and/or initial documentation
\r
12 package org.onap.sdc.workflowdesigner.resources;
\r
14 import static org.junit.Assert.assertEquals;
\r
16 import org.junit.After;
\r
17 import org.junit.Before;
\r
18 import org.junit.Test;
\r
19 import org.onap.sdc.workflowdesigner.resources.entity.ExtendActivity;
\r
20 import org.onap.sdc.workflowdesigner.utils.FileCommonUtils;
\r
21 import org.onap.sdc.workflowdesigner.utils.JsonUtils;
\r
26 public class ExtendActivityResourceTest {
\r
27 private static final String EXT_ACTIVITIES_FILE_NAME = "..\\distribution\\src\\main\\assembly\\ext-activities.json";
\r
30 * @throws java.lang.Exception
\r
33 public void setUp() throws Exception {}
\r
36 * @throws java.lang.Exception
\r
39 public void tearDown() throws Exception {}
\r
42 * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#retriveExtActivites(java.lang.String)}.
\r
45 public void testRetriveExtActivites() {
\r
47 String json = FileCommonUtils.readString(EXT_ACTIVITIES_FILE_NAME);
\r
48 ExtendActivity[] extActivities = JsonUtils.fromJson(json, ExtendActivity[].class);
\r
50 FileCommonUtils.write("test.json", JsonUtils.toJson(extActivities));
\r
51 assertEquals(extActivities.length == 0, false);
\r
52 } catch (Exception e) {
\r
53 e.printStackTrace();
\r
59 * Test method for {@link org.onap.sdc.workflowdesigner.resources.ExtendActivityResource#getDisplayInfo(java.lang.String)}.
\r
62 public void testGetDisplayInfo() {
\r