package io.magentys.cinnamon.conf;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class EnvTest {

    private Env env;

    @Before
    public void setUp() {
        System.setProperty("env", "example");
        System.setProperty("example.host", "foobar");
        env = Env.INSTANCE;
    }

    @Test
    public void testSystemPropertySubstitutionWorks() {
        assertEquals("foobar", env.config.getString("host"));
    }

    @Test
    public void testDefaultValueOfConfigItemWhenNoSystemPropertyOverrideIsSet() {
        assertEquals(8080, env.config.getInt("port"));
    }
}

@@ -185,16 +185,18 @@
 %0D%0A%0D%0A    
+//
 @Before%0D
@@ -359,32 +359,34 @@
 ;%0D%0A    %7D%0D%0A%0D%0A    
+//
 @Test%0D%0A    publi
@@ -509,16 +509,18 @@
 %0D%0A%0D%0A    
+//
 @Test%0D%0A 

disable EnvTest tests