mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix test ConfigTest such that it doesn't set the RunOnceMarker
When tests are run using for example -Dprops.file=testconfig/ebean-postgres.properties ... then we want ebean-test AutoConfigureForTesting to run and setup the default datasource appropriately. If ConfigTest runs before that then it sets the RunOnceMarker and the default datasource isn't adjusted
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package io.ebean.test.config.platform;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.datasource.DataSourceConfig;
|
||||
import io.ebeaninternal.api.DbOffline;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -12,6 +16,17 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class ConfigTest {
|
||||
|
||||
@BeforeAll
|
||||
public static void before() {
|
||||
// so that RunOnceMarker is not set when running these tests
|
||||
DbOffline.setPlatform(Platform.H2);
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void after() {
|
||||
DbOffline.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void trimExtensions() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user