/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
testing-modules/spring-testing-2/src/test/java/com/baeldung/activeprofile/ProdActiveProfileUnitTest.java
23 строки
835 B
laterlaugh
chore: remove repetitive words
12 апр 2024, 15:58
12 апр 2024, 15:58
fb4e371
Код
Авторство
О чём код?
package com.baeldung.activeprofile; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit.jupiter.EnabledIf; @SpringBootTest(classes = ActiveProfileApplication.class) @EnabledIf(value = "#{environment.getActiveProfiles()[0] == 'prod'}", loadContext = true) @ActiveProfiles(value = "prod") public class ProdActiveProfileUnitTest { @Value("${profile.property.value}") private String propertyString; @Test void whenProdIsActive_thenValueShouldBeKeptFromApplicationProdYaml() { Assertions.assertEquals("This the application-prod.yaml file", propertyString); } }