Search in sources :

Example 1 with StageConfig

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

the class StageConfigTest method testPropertyBasedConfigStagesFile.

@Test
public void testPropertyBasedConfigStagesFile() throws Exception {
    try {
        URL projectStages = getClass().getClassLoader().getResource("simple-project-stages.yml");
        System.setProperty(SwarmProperties.PROJECT_STAGE_FILE, projectStages.toExternalForm());
        Swarm swarm = new Swarm(new Properties());
        ConfigView view = swarm.configView();
        assertThat(view.resolve("foo.bar.baz").getValue()).isEqualTo("cheddar");
        StageConfig stageConfig = swarm.stageConfig();
        assertThat(stageConfig.resolve("foo.bar.baz").getValue()).isEqualTo("cheddar");
    } finally {
        System.clearProperty(SwarmProperties.PROJECT_STAGE_FILE);
    }
}
Also used : ConfigView(org.wildfly.swarm.spi.api.config.ConfigView) Properties(java.util.Properties) SwarmProperties(org.wildfly.swarm.spi.api.SwarmProperties) URL(java.net.URL) StageConfig(org.wildfly.swarm.spi.api.StageConfig) Test(org.junit.Test)

Aggregations

URL (java.net.URL)1 Properties (java.util.Properties)1 Test (org.junit.Test)1 StageConfig (org.wildfly.swarm.spi.api.StageConfig)1 SwarmProperties (org.wildfly.swarm.spi.api.SwarmProperties)1 ConfigView (org.wildfly.swarm.spi.api.config.ConfigView)1