application.properties도 동일합니다. 예시를 위해 yaml로 설정합니다.
- 여기에는 공통 구성이 포함됩니다.
java -jar [jar 파일명] --spring.profiles.active=local
Test Code가 정상적으로 동작하지 않는다고 당황하지 말자 아래의 방법이 있다.
@ActiveProfiles("dev")
@SpringBootTest
class ProfilesTest {
...
}
@Test
@Profile("dev")
@DisplayName("Profile Test")
void testCheck() {
...
}