Improved spring-properties-file-outside-jar with new 2.4.0 feature

This commit is contained in:
Gerardo Roza
2021-01-15 16:00:03 -03:00
parent 1c5185b549
commit 6b462cd6c6
4 changed files with 42 additions and 7 deletions
@@ -0,0 +1,22 @@
package com.baeldung.properties;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class ApplicationPropertyImportExternalFileIntegrationTest {
@Value("${bael.property1}")
String baelProperty;
@Test
public void whenExternalisedPropertiesLoadedUsinApplicationProperties_thenReadValues() throws IOException {
assertEquals(baelProperty, "value1");
}
}