Search in sources :

Example 11 with Validator

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);
}
Also used : ConfigFile(com.yahoo.elide.modelconfig.store.models.ConfigFile) RequestScope(com.yahoo.elide.core.RequestScope) DynamicConfigValidator(com.yahoo.elide.modelconfig.validator.DynamicConfigValidator) Validator(com.yahoo.elide.modelconfig.validator.Validator) DynamicConfigValidator(com.yahoo.elide.modelconfig.validator.DynamicConfigValidator) Test(org.junit.jupiter.api.Test)

Aggregations

DynamicConfigValidator (com.yahoo.elide.modelconfig.validator.DynamicConfigValidator)11 Validator (com.yahoo.elide.modelconfig.validator.Validator)11 Test (org.junit.jupiter.api.Test)11 ConfigFile (com.yahoo.elide.modelconfig.store.models.ConfigFile)9 RequestScope (com.yahoo.elide.core.RequestScope)7 File (java.io.File)3