mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Collect the DB schemas in the model via MTable
This commit is contained in:
@@ -10,6 +10,7 @@ import io.ebeaninternal.dbmigration.migrationreader.MigrationXmlReader;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -153,6 +154,22 @@ public class ModelContainerTest {
|
||||
container.applyChange(dropHistoryTable);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSchemas() {
|
||||
|
||||
MTable t0 = new MTable("foo.one");
|
||||
MTable t1 = new MTable("foo.two");
|
||||
MTable t2 = new MTable("bar.three");
|
||||
|
||||
ModelContainer container = new ModelContainer();
|
||||
container.addTable(t0);
|
||||
container.addTable(t1);
|
||||
container.addTable(t2);
|
||||
|
||||
final Set<String> schemas = container.getSchemas();
|
||||
assertThat(schemas).containsExactly("bar","foo");
|
||||
}
|
||||
|
||||
private ModelContainer container_2_1() {
|
||||
ModelContainer container = new ModelContainer();
|
||||
container.apply(mig("2.0.model.xml"), ver("2.0"));
|
||||
|
||||
Reference in New Issue
Block a user