/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
testing-modules/spring-testing/src/test/java/com/baeldung/testpropertysource/DefaultTestPropertySourceIntegrationTest.java
26 строк
874 B
Eric Martin
Merge pull request #8125 from eugenp/revert-8119-BAEL-3275-2
01 ноя 2019, 04:43
01 ноя 2019, 04:43
3225470
Код
Авторство
О чём код?
package com.baeldung.testpropertysource; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @ContextConfiguration(classes = ClassUsingProperty.class) @TestPropertySource public class DefaultTestPropertySourceIntegrationTest { @Autowired ClassUsingProperty classUsingProperty; @Test public void givenDefaultTestPropertySource_whenVariableOneRetrieved_thenValueInDefaultFileReturned() { String output = classUsingProperty.retrievePropertyOne(); assertThat(output).isEqualTo("default-value"); } }