Search in sources :

Example 1 with TestReferenceConfig

use of com.yahoo.foo.TestReferenceConfig in project vespa by vespa-engine.

the class FileConfigSubscriptionTest method require_that_dir_config_id_reference_is_not_changed.

@Test
public void require_that_dir_config_id_reference_is_not_changed() {
    final String cfgDir = "src/test/resources/configs/foo";
    final String cfgId = "dir:" + cfgDir;
    final ConfigKey<TestReferenceConfig> key = new ConfigKey<>(TestReferenceConfig.class, cfgId);
    ConfigSubscriber subscriber = new ConfigSubscriber();
    ConfigSubscription<TestReferenceConfig> sub = ConfigSubscription.get(key, subscriber, new DirSource(new File(cfgDir)), new TimingValues());
    assertTrue(sub.nextConfig(1000));
    assertThat(sub.getConfigState().getConfig().configId(), is(cfgId));
}
Also used : TestReferenceConfig(com.yahoo.foo.TestReferenceConfig) ConfigKey(com.yahoo.vespa.config.ConfigKey) ConfigSubscriber(com.yahoo.config.subscription.ConfigSubscriber) TimingValues(com.yahoo.vespa.config.TimingValues) DirSource(com.yahoo.config.subscription.DirSource) File(java.io.File) Test(org.junit.Test)

Aggregations

ConfigSubscriber (com.yahoo.config.subscription.ConfigSubscriber)1 DirSource (com.yahoo.config.subscription.DirSource)1 TestReferenceConfig (com.yahoo.foo.TestReferenceConfig)1 ConfigKey (com.yahoo.vespa.config.ConfigKey)1 TimingValues (com.yahoo.vespa.config.TimingValues)1 File (java.io.File)1 Test (org.junit.Test)1