mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
Refactor tests, move DbPrimaryTest to ebean-api
This commit is contained in:
1 parent
6a552cd7d1
commit
72963bc9fb
3 files changed
+30
-34
No files matched your search
@@ -0,0 +1,29 @@
|
|||||||
|
package io.ebean;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class DbPrimaryTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testIsSkipPrimaryServer() {
|
||||||
|
DbPrimary.setSkip(true);
|
||||||
|
assertTrue(DbPrimary.isSkip());
|
||||||
|
DbPrimary.setSkip(false);
|
||||||
|
assertFalse(DbPrimary.isSkip());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testGetPrimaryServerName() {
|
||||||
|
assertEquals("h2", DbPrimary.getDefaultServerName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testLoadProperties() {
|
||||||
|
Properties properties = DbPrimary.getProperties();
|
||||||
|
assertFalse(properties.isEmpty());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
datasource.default=h2
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package io.ebean;
|
|
||||||
|
|
||||||
import io.ebean.xtest.BaseTestCase;
|
|
||||||
import io.ebean.xtest.ForPlatform;
|
|
||||||
import io.ebean.annotation.Platform;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
public class DbPrimaryTest extends BaseTestCase {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testIsSkipPrimaryServer() {
|
|
||||||
DbPrimary.setSkip(true);
|
|
||||||
assertTrue(DbPrimary.isSkip());
|
|
||||||
DbPrimary.setSkip(false);
|
|
||||||
assertFalse(DbPrimary.isSkip());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@ForPlatform(Platform.H2)
|
|
||||||
public void testGetPrimaryServerName() {
|
|
||||||
String primaryServerName = DbPrimary.getDefaultServerName();
|
|
||||||
assertEquals("h2", primaryServerName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testLoadProperties() {
|
|
||||||
Properties properties = DbPrimary.getProperties();
|
|
||||||
assertTrue(!properties.isEmpty());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user