Skip to content

Commit 53b3576

Browse files
committed
Refactor infra.
1 parent 1ef2fab commit 53b3576

File tree

37 files changed

+105
-395
lines changed

37 files changed

+105
-395
lines changed

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/CustomerRepositoryProjectionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.junit.jupiter.api.AfterEach;
2323
import org.junit.jupiter.api.Test;
2424
import org.junit.jupiter.api.extension.ExtendWith;
25-
2625
import org.springframework.beans.factory.annotation.Autowired;
2726
import org.springframework.data.jpa.domain.sample.Country;
2827
import org.springframework.data.jpa.domain.sample.Customer;
@@ -37,7 +36,8 @@
3736
* @author Mark Paluch
3837
*/
3938
@ExtendWith(SpringExtension.class)
40-
@ContextConfiguration(locations = "classpath:config/namespace-application-context-h2.xml")
39+
@ContextConfiguration(
40+
locations = { "classpath:config/namespace-application-context.xml", "classpath:hibernate-h2-infrastructure.xml" })
4141
@Transactional
4242
class CustomerRepositoryProjectionTests {
4343

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkQueryByExampleIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
* @since 3.0
4242
*/
4343
@ExtendWith(SpringExtension.class)
44-
@ContextConfiguration({ "classpath:eclipselink.xml", "classpath:config/namespace-application-context.xml" })
44+
@ContextConfiguration({ "classpath:eclipselink-infrastructure.xml",
45+
"classpath:config/namespace-application-context.xml" })
4546
@Transactional
4647
class EclipseLinkQueryByExampleIntegrationTests {
4748

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkUserRepositoryFinderTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
* @author Oliver Gierke
2626
* @author Greg Turnquist
2727
*/
28-
@ContextConfiguration("classpath:eclipselink-h2.xml")
28+
@ContextConfiguration(value = { "classpath:config/namespace-application-context.xml", "classpath:eclipselink.xml",
29+
"classpath:h2.xml", "classpath:infrastructure.xml" }, inheritLocations = false)
2930
class EclipseLinkUserRepositoryFinderTests extends UserRepositoryFinderTests {
3031

3132
@Disabled

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EclipseLinkUserRepositoryProjectionTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
* @author Oliver Gierke
2323
* @author Greg Turnquist
2424
*/
25-
@ContextConfiguration("classpath:eclipselink-h2.xml")
25+
@ContextConfiguration(
26+
value = { "classpath:config/namespace-application-context.xml", "classpath:eclipselink-infrastructure.xml" },
27+
inheritLocations = false)
2628
class EclipseLinkUserRepositoryProjectionTests extends UserRepositoryProjectionTests {
2729

2830
@Disabled

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/EntityWithAssignedIdIntegrationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import org.junit.jupiter.api.Test;
2121
import org.junit.jupiter.api.extension.ExtendWith;
22-
2322
import org.springframework.beans.factory.annotation.Autowired;
2423
import org.springframework.data.jpa.domain.sample.EntityWithAssignedId;
2524
import org.springframework.data.jpa.repository.sample.EntityWithAssignedIdRepository;
@@ -31,7 +30,8 @@
3130
* @author Oliver Drotbohm
3231
*/
3332
@ExtendWith(SpringExtension.class)
34-
@ContextConfiguration("classpath:config/namespace-application-context.xml")
33+
@ContextConfiguration(
34+
locations = { "classpath:config/namespace-application-context.xml", "classpath:hibernate-infrastructure.xml" })
3535
@Transactional
3636
class EntityWithAssignedIdIntegrationTests {
3737

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/NamespaceUserRepositoryTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131
* @author Oliver Gierke
3232
* @author Eberhard Wolff
3333
*/
34-
@ContextConfiguration(locations = "classpath:config/namespace-application-context.xml", inheritLocations = false)
34+
@ContextConfiguration(
35+
locations = { "classpath:config/namespace-application-context.xml", "classpath:hibernate-infrastructure.xml" },
36+
inheritLocations = false)
3537
class NamespaceUserRepositoryTests extends UserRepositoryTests {
3638

37-
@Autowired
38-
ListableBeanFactory beanFactory;
39+
@Autowired ListableBeanFactory beanFactory;
3940

4041
@Test
4142
void registersPostProcessors() {

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.data.jpa.repository;
1717

18-
import static org.assertj.core.api.Assertions.assertThat;
18+
import static org.assertj.core.api.Assertions.*;
1919

2020
import jakarta.persistence.criteria.CriteriaBuilder;
2121
import jakarta.persistence.criteria.CriteriaQuery;
@@ -47,7 +47,8 @@
4747
*/
4848
@Transactional
4949
@ExtendWith(SpringExtension.class)
50-
@ContextConfiguration("classpath:config/namespace-application-context.xml")
50+
@ContextConfiguration(
51+
locations = { "classpath:config/namespace-application-context.xml", "classpath:hibernate-infrastructure.xml" })
5152
class ParentRepositoryIntegrationTests {
5253

5354
@Autowired ParentRepository repository;

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/QueryByExampleIntegrationTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.data.jpa.repository;
1717

18-
import static org.assertj.core.api.Assertions.assertThat;
18+
import static org.assertj.core.api.Assertions.*;
1919

2020
import jakarta.persistence.EntityManager;
2121
import jakarta.persistence.criteria.CriteriaBuilder;
@@ -47,7 +47,8 @@
4747
* @since 3.0
4848
*/
4949
@ExtendWith(SpringExtension.class)
50-
@ContextConfiguration({ "classpath:hibernate.xml", "classpath:config/namespace-application-context.xml" })
50+
@ContextConfiguration({ "classpath:hibernate-infrastructure.xml",
51+
"classpath:config/namespace-application-context.xml" })
5152
@Transactional
5253
class QueryByExampleIntegrationTests {
5354

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/SPR8954Tests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.data.jpa.repository;
1717

18-
import static org.assertj.core.api.Assertions.assertThat;
18+
import static org.assertj.core.api.Assertions.*;
1919

2020
import java.util.Map;
2121

@@ -34,7 +34,8 @@
3434
* @author Krzysztof Krason
3535
*/
3636
@ExtendWith(SpringExtension.class)
37-
@ContextConfiguration("classpath:config/namespace-application-context.xml")
37+
@ContextConfiguration(
38+
locations = { "classpath:config/namespace-application-context.xml", "classpath:hibernate-infrastructure.xml" })
3839
class SPR8954Tests {
3940

4041
@Autowired ApplicationContext context;

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.junit.jupiter.api.BeforeEach;
2828
import org.junit.jupiter.api.Test;
2929
import org.junit.jupiter.api.extension.ExtendWith;
30-
3130
import org.springframework.beans.factory.annotation.Autowired;
3231
import org.springframework.dao.InvalidDataAccessApiUsageException;
3332
import org.springframework.data.domain.Limit;
@@ -61,7 +60,8 @@
6160
* @see QueryLookupStrategy
6261
*/
6362
@ExtendWith(SpringExtension.class)
64-
@ContextConfiguration(locations = "classpath:config/namespace-application-context-h2.xml")
63+
@ContextConfiguration(
64+
locations = { "classpath:config/namespace-application-context.xml", "classpath:hibernate-h2-infrastructure.xml" })
6565
@Transactional
6666
class UserRepositoryFinderTests {
6767

0 commit comments

Comments
 (0)