Class SerializationTestKit
- java.lang.Object
-
- akka.actor.testkit.typed.scaladsl.SerializationTestKit
-
public class SerializationTestKit extends java.lang.Object
Utilities to test serialization.
-
-
Constructor Summary
Constructors Constructor Description SerializationTestKit(ActorSystem<?> system)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <M> M
verifySerialization(M obj)
Verify serialization roundtrip.<M> M
verifySerialization(M obj, boolean assertEquality)
Verify serialization roundtrip.
-
-
-
Constructor Detail
-
SerializationTestKit
public SerializationTestKit(ActorSystem<?> system)
-
-
Method Detail
-
verifySerialization
public <M> M verifySerialization(M obj)
Verify serialization roundtrip. Throws exception from serializer ifobj
can't be serialized and deserialized. Also tests that the deserialized object is equal toobj
, and if not anAssertionError
is thrown.- Parameters:
obj
- the object to verify- Returns:
- the deserialized object
-
verifySerialization
public <M> M verifySerialization(M obj, boolean assertEquality)
Verify serialization roundtrip. Throws exception from serializer ifobj
can't be serialized and deserialized.- Parameters:
obj
- the object to verifyassertEquality
- iftrue
the deserialized object is verified to be equal toobj
, and if not anAssertionError
is thrown- Returns:
- the deserialized object
-
-