Class PojoTestUtils


  • @PublicEvolving
    public class PojoTestUtils
    extends Object
    Test utils around POJOs.
    • Constructor Detail

      • PojoTestUtils

        public PojoTestUtils()
    • Method Detail

      • assertSerializedAsPojo

        public static <T> void assertSerializedAsPojo​(Class<T> clazz)
                                               throws AssertionError
        Verifies that instances of the given class fulfill all conditions to be serialized with the PojoSerializer, as documented here.

        Note that this check will succeed even if the Pojo is partially serialized with Kryo. If this is not desired, use assertSerializedAsPojoWithoutKryo(Class) instead.

        Type Parameters:
        T - class type
        Parameters:
        clazz - class to analyze
        Throws:
        AssertionError - if instances of the class cannot be serialized as a POJO
      • assertSerializedAsPojoWithoutKryo

        public static <T> void assertSerializedAsPojoWithoutKryo​(Class<T> clazz)
                                                          throws AssertionError
        Verifies that instances of the given class fulfill all conditions to be serialized with the PojoSerializer, as documented here, without any field being serialized with Kryo.
        Type Parameters:
        T - class type
        Parameters:
        clazz - class to analyze
        Throws:
        AssertionError - if instances of the class cannot be serialized as a POJO or required Kryo for one or more fields