BAEL-3905: Mark test ctx as dirty after each test method (#9784)
This commit is contained in:
parent
0cade733ca
commit
92b315a3a6
|
@ -3,13 +3,11 @@ package com.baeldung.testloglevel;
|
|||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
import com.baeldung.boot.Application;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"com.baeldung.testloglevel", "com.baeldung.component"})
|
||||
public class TestLogLevelApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
SpringApplication.run(TestLogLevelApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@ import org.springframework.test.context.ActiveProfiles;
|
|||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS;
|
||||
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD;
|
||||
|
||||
@DirtiesContext(classMode = AFTER_CLASS)
|
||||
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = TestLogLevelApplication.class)
|
||||
@EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class)
|
||||
|
|
|
@ -16,9 +16,9 @@ import org.springframework.test.context.ActiveProfiles;
|
|||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS;
|
||||
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD;
|
||||
|
||||
@DirtiesContext(classMode = AFTER_CLASS)
|
||||
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = TestLogLevelApplication.class)
|
||||
@EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class)
|
||||
|
|
|
@ -16,10 +16,10 @@ import org.springframework.test.context.ActiveProfiles;
|
|||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_CLASS;
|
||||
import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@DirtiesContext(classMode = AFTER_CLASS)
|
||||
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = TestLogLevelApplication.class)
|
||||
@EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class)
|
||||
@ActiveProfiles("logging-test")
|
||||
|
|
Loading…
Reference in New Issue