Search in sources :

Example 1 with CompositeKey

use of org.wildfly.swarm.spi.api.config.CompositeKey in project wildfly-swarm by wildfly-swarm.

the class CompositeKeyTest method testSubkey.

@Test
public void testSubkey() {
    CompositeKey key = new CompositeKey("foo", "bar", "baz");
    assertThat(key.subkey(1).head()).isEqualTo(new SimpleKey("bar"));
    assertThat(key.subkey(2).head()).isEqualTo(new SimpleKey("baz"));
    assertThat(key.subkey(3).head()).isEqualTo(ConfigKey.EMPTY);
}
Also used : CompositeKey(org.wildfly.swarm.spi.api.config.CompositeKey) SimpleKey(org.wildfly.swarm.spi.api.config.SimpleKey) Test(org.junit.Test)

Example 2 with CompositeKey

use of org.wildfly.swarm.spi.api.config.CompositeKey in project wildfly-swarm by wildfly-swarm.

the class CompositeKeyTest method testHead.

@Test
public void testHead() {
    CompositeKey key = new CompositeKey("foo", "bar", "baz");
    assertThat(key.head()).isEqualTo(new SimpleKey("foo"));
}
Also used : CompositeKey(org.wildfly.swarm.spi.api.config.CompositeKey) SimpleKey(org.wildfly.swarm.spi.api.config.SimpleKey) Test(org.junit.Test)

Example 3 with CompositeKey

use of org.wildfly.swarm.spi.api.config.CompositeKey in project wildfly-swarm by wildfly-swarm.

the class CompositeKeyTest method testName.

@Test
public void testName() {
    CompositeKey key = new CompositeKey("foo", "bar", "baz");
    assertThat(key.name()).isEqualTo("foo.bar.baz");
}
Also used : CompositeKey(org.wildfly.swarm.spi.api.config.CompositeKey) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 CompositeKey (org.wildfly.swarm.spi.api.config.CompositeKey)3 SimpleKey (org.wildfly.swarm.spi.api.config.SimpleKey)2