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
10 * ZTE - initial API and implementation and/or initial documentation
12 package org.onap.sdc.workflowdesigner.resources.entity;
14 import static org.junit.Assert.*;
16 import java.util.HashMap;
19 import org.junit.After;
20 import org.junit.Before;
21 import org.junit.Test;
22 import org.onap.sdc.workflowdesigner.utils.JsonUtils;
27 public class ContentTest {
30 * @throws java.lang.Exception
33 public void setUp() throws Exception {}
36 * @throws java.lang.Exception
39 public void tearDown() throws Exception {}
43 // String clazz = "clazz";
44 String script = "script";
45 String scriptFormat = "scriptFormat";
46 Map<String, InputOutput> inputs = new HashMap<String, InputOutput>();
47 Map<String, InputOutput> outputs = new HashMap<String, InputOutput>();
49 Content c = new Content();
52 c.setOutputs(outputs);
54 c.setScriptFormat(scriptFormat);
56 // assertEquals(clazz, c.getClazz());
57 assertEquals(inputs, c.getInputs());
58 assertEquals(outputs, c.getOutputs());
59 assertEquals(script, c.getScript());
60 assertEquals(scriptFormat, c.getScriptFormat());
64 public void testGson() {
65 String json = "{\r\n" +
66 " \"class\": \"aaaa\",\r\n" +
67 " \"inputs\": {}\r\n" +
69 Content content = JsonUtils.fromJson(json, Content.class);
70 assertNotNull(content);