re base code
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / servlets / RepresentationUtilsTest.java
1 package org.openecomp.sdc.be.servlets;
2
3 import org.apache.tinkerpop.gremlin.structure.T;
4 import org.junit.Test;
5 import org.openecomp.sdc.be.model.ArtifactDefinition;
6 import org.openecomp.sdc.be.model.Operation;
7
8 import java.util.HashMap;
9
10 import static org.junit.Assert.*;
11
12 public class RepresentationUtilsTest  {
13
14     private RepresentationUtils createTestSubject() {
15         return new RepresentationUtils();
16     }
17
18
19     @Test
20     public void testConvertJsonToArtifactDefinitionForUpdate() throws Exception {
21         String content = "";
22         Class<ArtifactDefinition> clazz = null;
23         ArtifactDefinition result;
24
25         // default test
26         result = RepresentationUtils.convertJsonToArtifactDefinitionForUpdate(content, clazz);
27     }
28
29
30     @Test
31     public void testToRepresentation() throws Exception {
32         T elementToRepresent = null;
33         Object result;
34
35         // default test
36         result = RepresentationUtils.toRepresentation(elementToRepresent);
37     }
38
39
40
41
42     @Test
43     public void testConvertJsonToArtifactDefinition() throws Exception {
44         String content = "";
45         Class<ArtifactDefinition> clazz = null;
46         ArtifactDefinition result;
47
48         // default test
49         result = RepresentationUtils.convertJsonToArtifactDefinition(content, clazz);
50     }
51
52     @Test
53     public void checkIsEmptyFiltering() throws Exception {
54         HashMap<String, Operation> op = new HashMap<>();
55         Operation opValue = new Operation();
56         opValue.setName("eee");
57         opValue.setDescription("ccc");
58         op.put("Bla", opValue);
59         Object result = RepresentationUtils.toRepresentation(op);
60         assertNotNull(result);
61         assertTrue(result.toString(), result.toString().contains("empty"));
62         result = RepresentationUtils.toFilteredRepresentation(op);
63         assertNotNull(result);
64         assertFalse(result.toString(), result.toString().contains("empty"));
65     }
66 }