blob: afba938a35db5345cab5df43325509ac50aa2bdb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.subscription;
import com.yahoo.foo.AppConfig;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class BasicTest {
@Test
public void testSubBasic() {
ConfigSubscriber s = new ConfigSubscriber();
ConfigHandle<AppConfig> h = s.subscribe(AppConfig.class, "raw:times 0");
s.nextConfig(0, false);
AppConfig c = h.getConfig();
assertEquals(0, c.times());
s.close();
}
@Test
public void testSubBasicGeneration() {
ConfigSubscriber s = new ConfigSubscriber();
ConfigHandle<AppConfig> h = s.subscribe(AppConfig.class, "raw:times 2");
s.nextGeneration(0, false);
AppConfig c = h.getConfig();
assertEquals(2, c.times());
s.close();
}
}
|