use of com.yahoo.elide.modelconfig.validator.Validator in project elide by yahoo.
the class ConfigDataStoreTest method testDelete.
@Test
public void testDelete(@TempDir Path configPath) {
String configRoot = configPath.toFile().getPath();
Validator validator = new DynamicConfigValidator(DefaultClassScanner.getInstance(), configRoot);
ConfigDataStore store = new ConfigDataStore(configRoot, validator);
ConfigFile newFile = createFile("test", store, false);
ConfigDataStoreTransaction tx = store.beginTransaction();
RequestScope scope = mock(RequestScope.class);
tx.delete(newFile, scope);
tx.flush(scope);
tx.commit(scope);
ConfigDataStoreTransaction readTx = store.beginReadTransaction();
ConfigFile loaded = readTx.loadObject(EntityProjection.builder().type(ClassType.of(ConfigFile.class)).build(), toId("models/tables/test.hjson", NO_VERSION), scope);
assertNull(loaded);
}
Aggregations