1 package org.openecomp.sdc.be.servlets;
3 import org.apache.tinkerpop.gremlin.structure.T;
5 import org.openecomp.sdc.be.model.ArtifactDefinition;
6 import org.openecomp.sdc.be.model.Operation;
8 import java.util.HashMap;
10 import static org.junit.Assert.*;
12 public class RepresentationUtilsTest {
14 private RepresentationUtils createTestSubject() {
15 return new RepresentationUtils();
20 public void testConvertJsonToArtifactDefinitionForUpdate() throws Exception {
22 Class<ArtifactDefinition> clazz = null;
23 ArtifactDefinition result;
26 result = RepresentationUtils.convertJsonToArtifactDefinitionForUpdate(content, clazz);
31 public void testToRepresentation() throws Exception {
32 T elementToRepresent = null;
36 result = RepresentationUtils.toRepresentation(elementToRepresent);
43 public void testConvertJsonToArtifactDefinition() throws Exception {
45 Class<ArtifactDefinition> clazz = null;
46 ArtifactDefinition result;
49 result = RepresentationUtils.convertJsonToArtifactDefinition(content, clazz);
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"));