@Test public void shouldReturnDefaultDbWhenNoExplicitConfigurationGiven() { BasicDocument configDocument = new BasicDocument(Schematic.TYPE_FIELD, RelationalDbConfig.ALIAS1); RelationalDb db = Schematic.getDb(configDocument); assertNotNull(db); assertEquals(RelationalDbConfig.DEFAULT_CONNECTION_URL, db.id()); RelationalDbConfig config = db.config(); assertNotNull(config); assertTrue(config.createOnStart()); assertFalse(config.dropOnExit()); assertEquals(RelationalDbConfig.DEFAULT_TABLE_NAME, config.tableName()); assertEquals(RelationalDbConfig.DEFAULT_FETCH_SIZE, config.fetchSize()); assertFalse(config.compress()); DataSourceManager dsManager = db.dsManager(); assertNotNull(dsManager); assertEquals(DatabaseType.Name.H2, dsManager.dbType().name()); }
@Override public RelationalDb getDB(String type, Document configuration) { if (!RelationalDbConfig.ALIASES.contains(type.toLowerCase())) { return null; } return new RelationalDb(configuration); }
RelationalProvider implements SchematicDbProvider<RelationalDb> { @Override public RelationalDb getDB(String type, Document configuration) { if (!RelationalDbConfig.ALIASES.contains(type.toLowerCase())) { return null; } return new RelationalDb(configuration); } }
RelationalProvider implements SchematicDbProvider<RelationalDb> { @Override public RelationalDb getDB(String type, Document configuration) { if (!RelationalDbConfig.ALIASES.contains(type.toLowerCase())) { return null; } return new RelationalDb(configuration); }  }
RelationalProvider implements SchematicDbProvider<RelationalDb> { @Override public RelationalDb getDB(String type, Document configuration) { if (!RelationalDbConfig.ALIASES.contains(type.toLowerCase())) { return null; } return new RelationalDb(configuration); }  @Override RelationalDb getDB(String type, Document configuration); }
RelationalProvider implements SchematicDbProvider<RelationalDb> { @Override public RelationalDb getDB(String type, Document configuration) { if (!RelationalDbConfig.ALIASES.contains(type.toLowerCase())) { return null; } return new RelationalDb(configuration); }  @Override RelationalDb getDB(String type, Document configuration);  }