diff options
Diffstat (limited to 'common/src/test')
-rw-r--r-- | common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java b/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java index ff940a0dea..e40c25a2e2 100644 --- a/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java +++ b/common/src/test/java/org/onap/so/client/aai/entities/AAIResultWrapperTest.java @@ -20,9 +20,10 @@ package org.onap.so.client.aai.entities; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; import java.io.IOException; +import java.io.Serializable; import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; @@ -30,11 +31,15 @@ import java.util.Map; import java.util.Optional; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import org.onap.aai.domain.yang.GenericVnf; import org.onap.so.client.aai.AAICommonObjectMapperProvider; +import org.springframework.util.SerializationUtils; + import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; @@ -43,7 +48,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; @RunWith(MockitoJUnitRunner.class) public class AAIResultWrapperTest { String json; - + @Rule + public ExpectedException thrown= ExpectedException.none(); + AAIResultWrapper aaiResultWrapper; AAIResultWrapper aaiResultWrapperEmpty; @@ -57,6 +64,14 @@ public class AAIResultWrapperTest { } @Test + public void testAAIResultWrapperIsSerializable() throws IOException { + AAIResultWrapper original = new AAIResultWrapper(""); + byte[] serialized = SerializationUtils.serialize(original); + AAIResultWrapper deserialized = (AAIResultWrapper) SerializationUtils.deserialize(serialized); + assertEquals(deserialized.getJson(), original.getJson()); + } + + @Test public void testGetRelationshipsEmpty() { Optional<Relationships> relationships = aaiResultWrapperEmpty.getRelationships(); assertEquals("Compare relationships", Optional.empty(), relationships); |