Need to run tests via gradle with spring profiles.
gradle clean build
I've added task:
task beforeTest() {
doLast {
System.setProperty("spring.profiles.active", "DEV")
}
}
test.dependsOn beforeTest
And my test definition is:
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("TestProfile")
public class SomeTest {
But this construction doesn't work for me.
Gradle runs tests.