Package org.axonframework.serializer

Examples of org.axonframework.serializer.ContentTypeConverter


                                                                                   InputStream.class);
        Upcaster mockUpcaster12 = new StubUpcaster<InputStream>(intermediate1.getType(), intermediate2_stream,
                                                                InputStream.class);

        ConverterFactory mockConverterFactory = mock(ConverterFactory.class);
        ContentTypeConverter mockByteToStreamConverter = mock(ContentTypeConverter.class);
        ContentTypeConverter mockStreamToByteConverter = mock(ContentTypeConverter.class);
        when(mockConverterFactory.getConverter(byte[].class, InputStream.class)).thenReturn(mockByteToStreamConverter);
        when(mockConverterFactory.getConverter(InputStream.class, byte[].class)).thenReturn(mockStreamToByteConverter);

        when(mockByteToStreamConverter.expectedSourceType()).thenReturn(byte[].class);
        when(mockStreamToByteConverter.targetType()).thenReturn(InputStream.class);
        when(mockByteToStreamConverter.convert(isA(SerializedObject.class)))
                .thenReturn(intermediate1_stream);
        when(mockStreamToByteConverter.convert(intermediate2_stream))
                .thenReturn(intermediate2_bytes);

        UpcasterChain chain = createUpcasterChain(mockConverterFactory, mockUpcaster12);

        List<SerializedObject> actualObjects = chain.upcast(object1, upcastingContext);
View Full Code Here

TOP

Related Classes of org.axonframework.serializer.ContentTypeConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.