File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
src/test/java/guru/springframework Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import org .junit .Test ;
4
4
import org .junit .runner .RunWith ;
5
+ import org .springframework .boot .test .context .SpringBootTest ;
6
+ import org .springframework .test .context .junit4 .SpringRunner ;
5
7
import org .springframework .test .context .web .WebAppConfiguration ;
6
- import org .springframework .boot .test .SpringApplicationConfiguration ;
7
- import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
8
8
9
- @ RunWith (SpringJUnit4ClassRunner .class )
10
- @ SpringApplicationConfiguration (classes = SpringBootWebApplication .class )
9
+
10
+ @ RunWith (SpringRunner .class )
11
+ @ SpringBootTest (classes = SpringBootWebApplication .class )
11
12
@ WebAppConfiguration
12
13
public class SpringBootWebApplicationTests {
13
14
Original file line number Diff line number Diff line change 1
1
package guru .springframework .configuration ;
2
2
3
3
import org .springframework .boot .autoconfigure .EnableAutoConfiguration ;
4
- import org .springframework .boot .orm . jpa .EntityScan ;
4
+ import org .springframework .boot .autoconfigure . domain .EntityScan ;
5
5
import org .springframework .context .annotation .Configuration ;
6
6
import org .springframework .data .jpa .repository .config .EnableJpaRepositories ;
7
7
import org .springframework .transaction .annotation .EnableTransactionManagement ;
Original file line number Diff line number Diff line change 5
5
import org .junit .Test ;
6
6
import org .junit .runner .RunWith ;
7
7
import org .springframework .beans .factory .annotation .Autowired ;
8
- import org .springframework .boot .test .SpringApplicationConfiguration ;
8
+ import org .springframework .boot .test .context . SpringBootTest ;
9
9
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
10
10
11
11
import java .math .BigDecimal ;
15
15
import static org .junit .Assert .assertNull ;
16
16
17
17
@ RunWith (SpringJUnit4ClassRunner .class )
18
- @ SpringApplicationConfiguration (classes = {RepositoryConfiguration .class })
18
+ @ SpringBootTest (classes = {RepositoryConfiguration .class })
19
19
public class ProductRepositoryTest {
20
20
21
21
private ProductRepository productRepository ;
You can’t perform that action at this time.
0 commit comments