Class SamplePrePersistHook

  • All Implemented Interfaces:
    PrePersistHook, org.junit.rules.TestRule

    public class SamplePrePersistHook
    extends org.junit.rules.ExternalResource
    implements PrePersistHook
    • Constructor Detail

      • SamplePrePersistHook

        public SamplePrePersistHook()
    • Method Detail

      • execute

        public java.util.Optional<ItemModel> execute​(ItemModel item)
        Description copied from interface: PrePersistHook
        Executes this hook before persisting the given item.
        Specified by:
        execute in interface PrePersistHook
        Parameters:
        item - an item to execute this hook with.
        Returns:
        result of processing/modification of the item by this hook to be persisted. If empty, that means there is no item to persist.
      • isExecuted

        public boolean isExecuted()
      • givenDoesInExecute

        public void givenDoesInExecute​(java.util.function.Function<ItemModel,​java.util.Optional<ItemModel>> function)
      • after

        public void after()
        Overrides:
        after in class org.junit.rules.ExternalResource