это не работает..
Код: Выделить всё
@TestPropertySource(properties = {"elastic.index=test_index"})
Код: Выделить всё
@TestPropertySource(locations = "/classpath:document.properties")
Код: Выделить всё
@PropertySource("classpath:/document.properties")
Код: Выделить всё
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
@TestPropertySource(properties = {"elastic.index=test_index"})
public class PropertyTests {
@Value("${elastic.index}")
String index;
@Configuration
@TestPropertySource(properties = {"elastic.index=test_index"})
static class ContextConfiguration {
}
@Test
public void wtf() {
assertEquals("test_index", index);
}
}
Код: Выделить всё
org.junit.ComparisonFailure:
Expected :test_index
Actual :${elastic.index}
Будем благодарны за любую информацию. Ура!
Подробнее здесь: https://stackoverflow.com/questions/326 ... ontextload