001package com.avaje.ebean;
002
003/**
004 * Test EbeanServer implementations that want to delegate some functionality
005 * through to a fully functional EbeanServer (that is typically using a test db like h2)
006 */
007public interface DelegateAwareEbeanServer {
008
009  /**
010   * Set the delegate if it has not already been set.
011   * <p/>
012   * This is typically used as part of MockiEbean run in order to support delegating
013   * through to the original default ebeanServer.
014   */
015  boolean withDelegateIfRequired(EbeanServer delegate);
016
017  /**
018   * Called prior to run and typically used to set test doubles to static finders.
019   */
020  void beforeRun();
021
022  /**
023   * Called after run and typically used to restore static finders (from their test doubles).
024   */
025  void afterRun();
026}