### Question:
SagaPersistenceLoader { public static PersistentStore load(final SagaPersistenceConfiguration persistenceConfiguration) { if (!persistenceConfiguration.isEnablePersistence()) { return new EmptySagaPersistence(); } PersistentStore result = null; for (PersistentStore each : ServiceLoader.load(PersistentStore.class)) { result = each; } if (null == result) { result = loadDefaultPersistence(persistenceConfiguration); } return result; }  static PersistentStore load(final SagaPersistenceConfiguration persistenceConfiguration);  }### Answer:
@Test(expected = PoolInitializationException.class) public void assertLoadDefaultPersistenceWithMySQL() { SagaPersistenceConfiguration persistenceConfiguration = new SagaPersistenceConfiguration(); persistenceConfiguration.setEnablePersistence(true); persistenceConfiguration.setUrl("jdbc:mysql: SagaPersistenceLoader.load(persistenceConfiguration); }
@Test public void assertLoadDefaultPersistenceWithH2() { SagaPersistenceConfiguration persistenceConfiguration = new SagaPersistenceConfiguration(); persistenceConfiguration.setEnablePersistence(true); persistenceConfiguration.setUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;"); assertThat(SagaPersistenceLoader.load(persistenceConfiguration), instanceOf(JDBCSagaPersistence.class)); }
@Test(expected = PoolInitializationException.class) public void assertWithoutJDBCDriver() { SagaPersistenceConfiguration persistenceConfiguration = new SagaPersistenceConfiguration(); persistenceConfiguration.setEnablePersistence(true); persistenceConfiguration.setUrl("jdbc:postgresql: SagaPersistenceLoader.load(persistenceConfiguration); }
@Test public void assertLoadDisabledPersistence() { SagaPersistenceConfiguration persistenceConfiguration = new SagaPersistenceConfiguration(); assertThat(SagaPersistenceLoader.load(persistenceConfiguration), instanceOf(EmptySagaPersistence.class)); }