File tree Expand file tree Collapse file tree 10 files changed +26
-13
lines changed
src/test/java/packagename/cucumber
java/packagename/repository/config
test/java/packagename/repository
src/test/java/packagename/rest Expand file tree Collapse file tree 10 files changed +26
-13
lines changed Original file line number Diff line number Diff line change 3737 <artifactId >spring-boot-starter-test</artifactId >
3838 <scope >test</scope >
3939 </dependency >
40+ <dependency >
41+ <groupId >org.springframework.boot</groupId >
42+ <artifactId >spring-boot-resttestclient</artifactId >
43+ <scope >test</scope >
44+ </dependency >
4045 <dependency >
4146 <groupId >com.h2database</groupId >
4247 <artifactId >h2</artifactId >
Original file line number Diff line number Diff line change 1111import java .util .List ;
1212import java .util .Map ;
1313import java .util .stream .Collectors ;
14- import org .springframework .boot .test . web . client .TestRestTemplate ;
14+ import org .springframework .boot .resttestclient .TestRestTemplate ;
1515import org .springframework .boot .test .web .server .LocalServerPort ;
1616import org .springframework .http .HttpStatus ;
1717import org .springframework .http .ResponseEntity ;
Original file line number Diff line number Diff line change 33import static org .springframework .boot .test .context .SpringBootTest .WebEnvironment .RANDOM_PORT ;
44
55import io .cucumber .spring .CucumberContextConfiguration ;
6+ import org .springframework .boot .resttestclient .autoconfigure .AutoConfigureTestRestTemplate ;
67import org .springframework .boot .test .context .SpringBootTest ;
78import org .springframework .test .context .ActiveProfiles ;
89import packagename .boot .ExampleApplication ;
910
1011@ SpringBootTest (classes = ExampleApplication .class , webEnvironment = RANDOM_PORT )
1112@ CucumberContextConfiguration
1213@ ActiveProfiles ("test" )
14+ @ AutoConfigureTestRestTemplate
1315public class SpringCucumberTestConfig {}
Original file line number Diff line number Diff line change 2121 <artifactId >spring-boot-starter-data-jpa</artifactId >
2222 </dependency >
2323 <dependency >
24- <groupId >org.liquibase </groupId >
25- <artifactId >liquibase-core </artifactId >
24+ <groupId >org.springframework.boot </groupId >
25+ <artifactId >spring-boot-starter-liquibase </artifactId >
2626 <exclusions >
2727 <exclusion >
28- <artifactId >commons-text</artifactId >
2928 <groupId >org.apache.commons</groupId >
29+ <artifactId >commons-text</artifactId >
3030 </exclusion >
3131 </exclusions >
3232 </dependency >
5353 <artifactId >spring-boot-starter-test</artifactId >
5454 <scope >test</scope >
5555 </dependency >
56+ <dependency >
57+ <groupId >org.springframework.boot</groupId >
58+ <artifactId >spring-boot-starter-data-jpa-test</artifactId >
59+ <scope >test</scope >
60+ </dependency >
5661 <dependency >
5762 <groupId >com.h2database</groupId >
5863 <artifactId >h2</artifactId >
Original file line number Diff line number Diff line change 11package packagename .repository .config ;
22
3- import org .springframework .boot .autoconfigure . domain .EntityScan ;
3+ import org .springframework .boot .persistence . autoconfigure .EntityScan ;
44import org .springframework .context .annotation .Bean ;
55import org .springframework .context .annotation .Configuration ;
66import org .springframework .data .envers .repository .support .EnversRevisionRepositoryFactoryBean ;
File renamed without changes.
Original file line number Diff line number Diff line change 11package packagename .repository ;
22
3- import net .lbruun .springboot .preliquibase .PreLiquibaseAutoConfiguration ;
43import org .springframework .boot .SpringApplication ;
5- import org .springframework .boot .autoconfigure .ImportAutoConfiguration ;
64import org .springframework .boot .autoconfigure .SpringBootApplication ;
75import org .springframework .boot .test .context .TestConfiguration ;
86import org .springframework .context .annotation .Import ;
@@ -17,6 +15,5 @@ public static void main(String[] args) {
1715
1816 @ TestConfiguration
1917 @ Import (JpaAdapterConfig .class )
20- @ ImportAutoConfiguration ({PreLiquibaseAutoConfiguration .class })
2118 static class ExampleJpaTestConfig {}
2219}
Original file line number Diff line number Diff line change 66import org .junit .jupiter .api .Test ;
77import org .junit .jupiter .api .extension .ExtendWith ;
88import org .springframework .beans .factory .annotation .Autowired ;
9- import org .springframework .boot .test . autoconfigure . orm . jpa .DataJpaTest ;
9+ import org .springframework .boot .data . jpa . test . autoconfigure .DataJpaTest ;
1010import org .springframework .test .context .ActiveProfiles ;
1111import org .springframework .test .context .jdbc .Sql ;
1212import org .springframework .test .context .junit .jupiter .SpringExtension ;
Original file line number Diff line number Diff line change 3535 <artifactId >spring-boot-starter-test</artifactId >
3636 <scope >test</scope >
3737 </dependency >
38+ <dependency >
39+ <groupId >org.springframework.boot</groupId >
40+ <artifactId >spring-boot-resttestclient</artifactId >
41+ <scope >test</scope >
42+ </dependency >
3843 </dependencies >
3944 <build >
4045 <plugins >
Original file line number Diff line number Diff line change 1313import org .mockito .Mockito ;
1414import org .mockito .junit .jupiter .MockitoExtension ;
1515import org .springframework .beans .factory .annotation .Autowired ;
16- import org .springframework .boot .autoconfigure . EnableAutoConfiguration ;
17- import org .springframework .boot .autoconfigure .jdbc . DataSourceAutoConfiguration ;
16+ import org .springframework .boot .resttestclient . TestRestTemplate ;
17+ import org .springframework .boot .resttestclient . autoconfigure .AutoConfigureTestRestTemplate ;
1818import org .springframework .boot .test .context .SpringBootTest ;
19- import org .springframework .boot .test .web .client .TestRestTemplate ;
2019import org .springframework .boot .test .web .server .LocalServerPort ;
2120import org .springframework .http .HttpStatus ;
2221import org .springframework .test .context .bean .override .mockito .MockitoBean ;
2827
2928@ ExtendWith (MockitoExtension .class )
3029@ SpringBootTest (classes = ExampleRestAdapterApplication .class , webEnvironment = RANDOM_PORT )
31- @ EnableAutoConfiguration ( exclude = { DataSourceAutoConfiguration . class })
30+ @ AutoConfigureTestRestTemplate
3231public class ExampleResourceTest {
3332
3433 private static final String LOCALHOST = "http://localhost:" ;
You can’t perform that action at this time.
0 commit comments