Class ReturnsDeepStubs.ReturnsDeepStubsSerializationFallback
java.lang.Object
org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs
org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs.ReturnsDeepStubsSerializationFallback
- All Implemented Interfaces:
Serializable, Answer<Object>
- Enclosing class:
ReturnsDeepStubs
private static class ReturnsDeepStubs.ReturnsDeepStubsSerializationFallback
extends ReturnsDeepStubs
implements Serializable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReturnsDeepStubsSerializationFallback(GenericMetadataSupport returnTypeGenericMetadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected GenericMetadataSupportprivate ObjectGenerics support and serialization with deep stubs don't work together.Methods inherited from class ReturnsDeepStubs
answer
-
Field Details
-
returnTypeGenericMetadata
-
-
Constructor Details
-
ReturnsDeepStubsSerializationFallback
-
-
Method Details
-
actualParameterizedType
- Overrides:
actualParameterizedTypein classReturnsDeepStubs
-
writeReplace
Generics support and serialization with deep stubs don't work together.The issue is that GenericMetadataSupport is not serializable because the type elements inferred via reflection are not serializable. Supporting serialization would require to replace all types coming from the Java reflection with our own and still managing type equality with the JDK ones.
- Throws:
IOException
-