use of com.mesosphere.sdk.config.StringConfiguration in project dcos-commons by mesosphere.
the class ConfigStoreTest method beforeEach.
@Before
public void beforeEach() throws Exception {
persister = new MemPersister();
store = new ConfigStore<StringConfiguration>(new StringConfiguration.Factory(), persister);
testConfig = new StringConfiguration("test-config");
}
use of com.mesosphere.sdk.config.StringConfiguration in project dcos-commons by mesosphere.
the class ConfigStoreTest method testNamespacedPathMapping.
@Test
public void testNamespacedPathMapping() throws Exception {
store = new ConfigStore<StringConfiguration>(new StringConfiguration.Factory(), persister, NAMESPACE);
UUID id = store.store(testConfig);
store.setTargetConfig(id);
// Check that data is in namespaced path:
Assert.assertEquals(id.toString(), new String(persister.get(NAMESPACE_PATH + "/ConfigTarget"), StandardCharsets.UTF_8));
Assert.assertNotEquals(0, persister.get(NAMESPACE_PATH + "/Configurations/" + id.toString()).length);
// Check that data is NOT in root path:
checkPathNotFound("ConfigTarget");
checkPathNotFound("Configurations/" + id.toString());
// Check that data is accessible as expected:
Assert.assertEquals(id, store.getTargetConfig());
Assert.assertEquals(testConfig, store.fetch(id));
}
use of com.mesosphere.sdk.config.StringConfiguration in project dcos-commons by mesosphere.
the class ConfigStoreTest method testStoreFetchConfig.
@Test
public void testStoreFetchConfig() throws Exception {
UUID testId = store.store(testConfig);
StringConfiguration config = store.fetch(testId);
Assert.assertEquals(testConfig, config);
}
Aggregations