Class DataMapperTest
java.lang.Object
test.de.iip_ecosphere.platform.services.environment.DataMapperTest
Tests
DataMapper.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGenerated data unit, representing alternative intputs to a service.static classA test class.static classSome input data for a service.static classSome input data for a service. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidAsserts an instance ofDataMapperTest.MyInput1againstcreateTestInputStream().private static voidAsserts an instance ofDataMapperTest.MyInput2againstcreateTestInputStream().private static InputStreamCreates a test input stream with 2 elements.protected <T> byte[]serialize(T data) Dynamically select a serializer (adapted from AbtractTransportConnector).voidTests serialization/deserialization for base data units.voidTestsDataMapper.createBaseDataUnitClass(Class).voidTestsDataMapper.mapJsonData(InputStream, Class, Consumer)withDataMapper.MappingConsumer.voidTestsDataMapper.mapJsonData(InputStream, Class, Consumer).
-
Field Details
-
count
private static int count
-
-
Constructor Details
-
DataMapperTest
public DataMapperTest()
-
-
Method Details
-
createTestInputStream
Creates a test input stream with 2 elements.- Returns:
- the input stream
-
assertMyInput1
Asserts an instance ofDataMapperTest.MyInput1againstcreateTestInputStream().- Parameters:
input- the input instance
-
assertMyInput2
Asserts an instance ofDataMapperTest.MyInput2againstcreateTestInputStream().- Parameters:
input- the input instance
-
testJsonDataMapper
TestsDataMapper.mapJsonData(InputStream, Class, Consumer).- Throws:
IOException- shall not occur
-
testGenericJsonDataMapper
TestsDataMapper.mapJsonData(InputStream, Class, Consumer)withDataMapper.MappingConsumer.- Throws:
IOException- shall not occur
-
testCreateBaseDataUnitClass
public void testCreateBaseDataUnitClass()TestsDataMapper.createBaseDataUnitClass(Class). -
testBaseDataUnitSerialization
Tests serialization/deserialization for base data units. Replays part of the mocking connector wrappers.- Throws:
IOException- shall not occur
-
serialize
Dynamically select a serializer (adapted from AbtractTransportConnector).- Type Parameters:
T- the type of the data- Parameters:
data- the data to serialize- Returns:
- the serialized bytes
- Throws:
IOException- in case that problems occur during serialization
-