|
23 | 23 | import org.apache.ibatis.session.SqlSession; |
24 | 24 | import org.apache.ibatis.session.SqlSessionFactory; |
25 | 25 | import org.junit.jupiter.api.Test; |
26 | | -import org.junit.jupiter.api.extension.ExtendWith; |
27 | 26 | import org.mybatis.spring.SqlSessionFactoryBean; |
28 | 27 | import org.mybatis.spring.SqlSessionTemplate; |
29 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
|
33 | 32 | import org.springframework.data.jdbc.core.convert.DataAccessStrategy; |
34 | 33 | import org.springframework.data.jdbc.core.convert.JdbcConverter; |
35 | 34 | import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories; |
| 35 | +import org.springframework.data.jdbc.testing.DatabaseType; |
| 36 | +import org.springframework.data.jdbc.testing.EnabledOnDatabase; |
| 37 | +import org.springframework.data.jdbc.testing.IntegrationTest; |
| 38 | +import org.springframework.data.jdbc.testing.TestClass; |
36 | 39 | import org.springframework.data.jdbc.testing.TestConfiguration; |
37 | 40 | import org.springframework.data.relational.core.dialect.HsqlDbDialect; |
38 | 41 | import org.springframework.data.relational.core.mapping.RelationalMappingContext; |
39 | 42 | import org.springframework.data.repository.CrudRepository; |
40 | 43 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; |
41 | 44 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; |
42 | | -import org.springframework.test.context.ActiveProfiles; |
43 | | -import org.springframework.test.context.ContextConfiguration; |
44 | | -import org.springframework.test.context.junit.jupiter.SpringExtension; |
45 | | -import org.springframework.transaction.annotation.Transactional; |
46 | 45 |
|
47 | 46 | /** |
48 | 47 | * Tests the integration with Mybatis. |
|
51 | 50 | * @author Greg Turnquist |
52 | 51 | * @author Mark Paluch |
53 | 52 | */ |
54 | | -@ContextConfiguration |
55 | | -@ActiveProfiles("hsql") |
56 | | -@Transactional |
57 | | -@ExtendWith(SpringExtension.class) |
| 53 | +@IntegrationTest |
| 54 | +@EnabledOnDatabase(DatabaseType.HSQL) |
58 | 55 | public class MyBatisHsqlIntegrationTests { |
59 | 56 |
|
60 | 57 | @Autowired SqlSessionFactory sqlSessionFactory; |
@@ -91,8 +88,8 @@ interface DummyEntityRepository extends CrudRepository<DummyEntity, Long> { |
91 | 88 | static class Config { |
92 | 89 |
|
93 | 90 | @Bean |
94 | | - Class<?> testClass() { |
95 | | - return MyBatisHsqlIntegrationTests.class; |
| 91 | + TestClass testClass() { |
| 92 | + return TestClass.of(MyBatisHsqlIntegrationTests.class); |
96 | 93 | } |
97 | 94 |
|
98 | 95 | @Bean |
|
0 commit comments