21
21
import org .springframework .boot .SpringApplication ;
22
22
import org .springframework .boot .autoconfigure .PropertyPlaceholderAutoConfiguration ;
23
23
import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
24
+ import org .springframework .boot .autoconfigure .jdbc .EmbeddedDataSourceConfiguration ;
24
25
import org .springframework .boot .autoconfigure .orm .jpa .HibernateJpaAutoConfiguration ;
25
26
import org .springframework .boot .autoconfigure .security .SecurityAutoConfiguration ;
26
27
import org .springframework .boot .autoconfigure .security .user .SecurityConfig ;
27
28
import org .springframework .boot .test .SpringApplicationConfiguration ;
28
29
import org .springframework .context .annotation .ComponentScan ;
29
30
import org .springframework .context .annotation .Import ;
31
+ import org .springframework .test .annotation .DirtiesContext ;
30
32
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
31
33
32
34
/**
39
41
*/
40
42
@ RunWith (SpringJUnit4ClassRunner .class )
41
43
@ SpringApplicationConfiguration (classes = JpaUserDetailsTests .Main .class )
44
+ @ DirtiesContext
42
45
public class JpaUserDetailsTests {
43
46
44
47
@ Test
@@ -49,7 +52,8 @@ public static void main(String[] args) throws Exception {
49
52
SpringApplication .run (Main .class , args );
50
53
}
51
54
52
- @ Import ({ DataSourceAutoConfiguration .class , HibernateJpaAutoConfiguration .class ,
55
+ @ Import ({ EmbeddedDataSourceConfiguration .class , DataSourceAutoConfiguration .class ,
56
+ HibernateJpaAutoConfiguration .class ,
53
57
PropertyPlaceholderAutoConfiguration .class , SecurityAutoConfiguration .class })
54
58
@ ComponentScan (basePackageClasses = SecurityConfig .class )
55
59
public static class Main {
0 commit comments