Browse Source

Add `@ContextConfiguration(…)` to integration tests with super classes.

Closes #2196
issue/2199
Mark Paluch 6 days ago
parent
commit
f67b49879b
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 2
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/AotJdbcRepositoryIntegrationTests.java
  2. 2
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryCreateIfNotFoundLookUpStrategyTests.java
  3. 3
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryCreateLookUpStrategyTests.java
  4. 2
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryDeclaredLookUpStrategyTests.java

2
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/AotJdbcRepositoryIntegrationTests.java

@ -34,6 +34,7 @@ import org.springframework.data.jdbc.testing.EnabledOnDatabase; @@ -34,6 +34,7 @@ import org.springframework.data.jdbc.testing.EnabledOnDatabase;
import org.springframework.data.jdbc.testing.IntegrationTest;
import org.springframework.data.jdbc.testing.TestClass;
import org.springframework.data.repository.core.support.RepositoryComposition;
import org.springframework.test.context.ContextConfiguration;
/**
* Integration test for {@link DummyEntityRepository} using JavaConfig with mounted AOT-generated repository methods.
@ -42,6 +43,7 @@ import org.springframework.data.repository.core.support.RepositoryComposition; @@ -42,6 +43,7 @@ import org.springframework.data.repository.core.support.RepositoryComposition;
* @author Christoph Strobl
*/
@IntegrationTest
@ContextConfiguration(classes = AotJdbcRepositoryIntegrationTests.AotConfig.class)
@EnabledOnDatabase(DatabaseType.H2)
class AotJdbcRepositoryIntegrationTests extends JdbcRepositoryIntegrationTests {

2
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryCreateIfNotFoundLookUpStrategyTests.java

@ -26,6 +26,7 @@ import org.springframework.data.jdbc.testing.IntegrationTest; @@ -26,6 +26,7 @@ import org.springframework.data.jdbc.testing.IntegrationTest;
import org.springframework.data.jdbc.testing.TestClass;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.test.context.ContextConfiguration;
/**
* Test to verify that
@ -36,6 +37,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy; @@ -36,6 +37,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy;
* @author Jens Schauder
*/
@IntegrationTest
@ContextConfiguration(classes = JdbcRepositoryCreateIfNotFoundLookUpStrategyTests.Config.class)
class JdbcRepositoryCreateIfNotFoundLookUpStrategyTests extends AbstractJdbcRepositoryLookUpStrategyTests {
@Test // GH-1043

3
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryCreateLookUpStrategyTests.java

@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
package org.springframework.data.jdbc.repository;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@ -26,6 +27,7 @@ import org.springframework.data.jdbc.testing.IntegrationTest; @@ -26,6 +27,7 @@ import org.springframework.data.jdbc.testing.IntegrationTest;
import org.springframework.data.jdbc.testing.TestClass;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.test.context.ContextConfiguration;
/**
* Test to verify that <code>@EnableJdbcRepositories(queryLookupStrategy = QueryLookupStrategy.Key.CREATE)</code> works
@ -35,6 +37,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy; @@ -35,6 +37,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy;
* @author Jens Schauder
*/
@IntegrationTest
@ContextConfiguration(classes = JdbcRepositoryCreateLookUpStrategyTests.Config.class)
class JdbcRepositoryCreateLookUpStrategyTests extends AbstractJdbcRepositoryLookUpStrategyTests {
@Test // GH-1043

2
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryDeclaredLookUpStrategyTests.java

@ -13,6 +13,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories; @@ -13,6 +13,7 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
import org.springframework.data.jdbc.testing.TestClass;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.test.context.ContextConfiguration;
/**
* Test to verify that
@ -21,6 +22,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy; @@ -21,6 +22,7 @@ import org.springframework.data.repository.query.QueryLookupStrategy;
*
* @author Diego Krupitza
*/
@ContextConfiguration(classes = JdbcRepositoryDeclaredLookUpStrategyTests.Config.class)
class JdbcRepositoryDeclaredLookUpStrategyTests extends AbstractJdbcRepositoryLookUpStrategyTests {
@Test // GH-1043

Loading…
Cancel
Save