Skip to content

Commit a8fb883

Browse files
committed
GH-1433 - We now properly match test path folders in BuildSystemUtils.pointsToMavenTestTarget(…).
1 parent c7bdb65 commit a8fb883

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-modulith-docs/src/main/java/org/springframework/modulith/docs/util/BuildSystemUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static String getResourceTarget() {
8888
}
8989

9090
static boolean pointsToMavenTestTarget(String path) {
91-
return path.matches("target\\/test-classes\\/.*");
91+
return path.matches("(.*\\/)?target\\/test-classes\\/.*");
9292
}
9393

9494
static boolean pointsToGradleTestTarget(String path) {

spring-modulith-docs/src/test/java/org/springframework/modulith/docs/util/BuildSystemUtilsUnitTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
*/
3030
class BuildSystemUtilsUnitTests {
3131

32-
@TestFactory // GH-1386
32+
@TestFactory // GH-1386, GH-1432
3333
Stream<DynamicTest> detectsMavenTargetResources() {
3434

35-
var values = getSampleResources("target/test-classes");
35+
var values = getSampleResources("target/test-classes", "some-folder/target/test-classes");
3636

3737
return DynamicTest.stream(values, it -> it + " is a test resource", it -> {
3838
assertThat(BuildSystemUtils.pointsToTestTarget(it)).isTrue();
@@ -46,7 +46,7 @@ Stream<DynamicTest> detectsGradleTargetResources() {
4646
"build/classes/java/test",
4747
"build/classes/kotlin/test",
4848
"build/tmp/kapt3/classes/testFixtures",
49-
"file:///full/path/to/project/build/tmp/kapt3/classes/test");
49+
"file:///full/path/to/project/build/tmp/kapt3/classes/test");
5050

5151
return DynamicTest.stream(values, it -> it + " is a test resource", it -> {
5252
assertThat(BuildSystemUtils.pointsToGradleTestTarget(it)).isTrue();

0 commit comments

Comments
 (0)