use of com.rebuild.core.metadata.impl.Entity2Schema in project rebuild by getrebuild.
the class MetaschemaImporterTest method testImport.
@Test
void testImport() throws Exception {
File file = ResourceUtils.getFile("classpath:metaschema-test.json");
String text = FileUtils.readFileToString(file, "utf-8");
JSONObject data = JSON.parseObject(text);
String entityName = data.getString("entity");
if (MetadataHelper.containsEntity(entityName)) {
new Entity2Schema(UserService.ADMIN_USER).dropEntity(MetadataHelper.getEntity(entityName), true);
}
MetaschemaImporter importer = new MetaschemaImporter(data);
TaskExecutors.run((HeavyTask<?>) importer.setUser(UserService.ADMIN_USER));
}
Aggregations