Skip to content

Commit 7d80f0e

Browse files
committed
Update tests so that they also work on Windows
See gh-3274
1 parent 4d0996b commit 7d80f0e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/GrapeRootRepositorySystemSessionAutoConfigurationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.cli.compiler.grape;
1818

19+
import java.io.File;
20+
1921
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
2022
import org.eclipse.aether.DefaultRepositorySystemSession;
2123
import org.eclipse.aether.RepositorySystem;
@@ -103,7 +105,7 @@ public void grapeRootConfiguresLocalRepositoryLocation() {
103105

104106
assertThat(this.session.getLocalRepository(), is(notNullValue()));
105107
assertThat(this.session.getLocalRepository().getBasedir().getAbsolutePath(),
106-
endsWith("/foo/repository"));
108+
endsWith(File.separatorChar + "foo" + File.separatorChar + "repository"));
107109
}
108110

109111
private class LocalRepositoryManagerAnswer implements Answer<LocalRepositoryManager> {

spring-boot-cli/src/test/java/org/springframework/boot/cli/compiler/grape/SettingsXmlRepositorySystemSessionAutoConfigurationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.cli.compiler.grape;
1818

19+
import java.io.File;
20+
1921
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
2022
import org.apache.maven.settings.building.SettingsBuildingException;
2123
import org.eclipse.aether.DefaultRepositorySystemSession;
@@ -98,7 +100,7 @@ public LocalRepositoryManager answer(InvocationOnMock invocation)
98100
}
99101

100102
assertThat(session.getLocalRepository().getBasedir().getAbsolutePath(),
101-
endsWith("/bar/repository"));
103+
endsWith(File.separatorChar + "bar" + File.separatorChar + "repository"));
102104
}
103105

104106
private void assertSessionCustomization(String userHome) {

0 commit comments

Comments
 (0)