Skip to content

Commit b27c962

Browse files
committed
DATAJPA-1017 - Tweaked test setup to run fine against Spring 5.
We now use Hibernate 4.3 when running CI tests for Spring 5. Adapted to template method signature change in PathMatchingResourcePatternResolver.
1 parent d114e45 commit b27c962

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ env:
88
- PROFILE=ci
99
- PROFILE=spring43
1010
- PROFILE=spring43-next
11-
- PROFILE=spring5
12-
- PROFILE=spring5-next
11+
- PROFILE=spring5,hibernate-43
12+
- PROFILE=spring5-next,hibernate-43
1313
- PROFILE=hibernate-41
1414
- PROFILE=hibernate-42
1515
- PROFILE=hibernate-42-next

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@
597597

598598
<pluginRepositories>
599599
<pluginRepository>
600-
<id>spring-plugins-release</id>
601-
<url>https://repo.spring.io/plugins-release</url>
600+
<id>spring-plugins-snapshot</id>
601+
<url>https://repo.spring.io/plugins-snapshot</url>
602602
</pluginRepository>
603603
</pluginRepositories>
604604

src/test/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessorUnitTests.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static org.mockito.Mockito.*;
1919

2020
import java.io.IOException;
21+
import java.net.URL;
2122
import java.util.Arrays;
2223
import java.util.Collections;
2324
import java.util.Set;
@@ -138,15 +139,19 @@ public Resource[] getResources(String locationPattern) throws IOException {
138139
return resources;
139140
}
140141

142+
/*
143+
* (non-Javadoc)
144+
* @see org.springframework.core.io.support.PathMatchingResourcePatternResolver#doFindPathMatchingJarResources(org.springframework.core.io.Resource, java.net.URL, java.lang.String)
145+
*/
141146
@Override
142-
protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource, String subPattern)
143-
throws IOException {
147+
protected Set<Resource> doFindPathMatchingJarResources(Resource rootDirResource, URL rootDirURL,
148+
String subPattern) throws IOException {
144149

145-
if (fileInJarUrl.equals(rootDirResource.getURI().toString())) {
150+
if (fileInJarUrl.equals(rootDirURL.toString())) {
146151
return Collections.singleton(rootDirResource);
147152
}
148153

149-
return super.doFindPathMatchingJarResources(rootDirResource, subPattern);
154+
return super.doFindPathMatchingJarResources(rootDirResource, rootDirURL, subPattern);
150155
}
151156
};
152157

0 commit comments

Comments
 (0)