package com.school1024.spring.boot.multi.env;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
public class SpringBootEnvTest extends AbstractJUnit4SpringContextTests {

    @Test
    public void test0() {
        String[] activeProfiles = applicationContext.getEnvironment().getActiveProfiles();
        for (String activeProfile : activeProfiles) {
            System.out.println(activeProfile);
        }
    }

    @Value("${project.env}")
    private String projectENV;

    @Test
    public void test1() {
        System.out.println(projectENV);
    }

}