forked from Realhedin/topjava02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDbTest.java
More file actions
37 lines (31 loc) · 949 Bytes
/
DbTest.java
File metadata and controls
37 lines (31 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package ru.javawebinar.topjava.service;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import ru.javawebinar.topjava.util.DbPopulator;
/**
* User: gkislin
* Date: 10.08.2014
*/
@ContextConfiguration({
"classpath:spring/spring-app.xml",
"classpath:spring/spring-db.xml"
})
@RunWith(SpringJUnit4ClassRunner.class)
abstract public class DbTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Autowired
private DbPopulator dbPopulator;
@Autowired
protected UserService userService;
@Before
public void setUp() throws Exception {
dbPopulator.execute();
userService.evictCache();
}
}