Class PersistenceTestUtils


  • public class PersistenceTestUtils
    extends java.lang.Object
    Utility class for tests. Allows to verify if the tested model is fully SLD compatible.
    • Constructor Detail

      • PersistenceTestUtils

        public PersistenceTestUtils()
    • Method Detail

      • saveAndVerifyThatPersistedThroughSld

        public static <T extends AbstractItemModel> void saveAndVerifyThatPersistedThroughSld​(ModelService modelService,
                                                                                              T item)
        Saves and asserts that a given item is saved through SLD instead of Jalo.
        Parameters:
        modelService - model service for item saving
        item - item to save
      • verifyThatUnderlyingPersistenceObjectIsSld

        public static void verifyThatUnderlyingPersistenceObjectIsSld​(ItemModel item)
        Asserts if a given item is backed by persistence object of SLD type.
        Parameters:
        item - item to verify
      • adjustToDB

        public static java.util.Date adjustToDB​(java.util.Date date)
        Simulates the effect of database storing a particular date.

        On MySQL this means dropping all milliseconds!