Use platform file separator in SimpleMapConverterTest instead of '/'

This commit is contained in:
Kim Shepherd
2022-06-24 18:55:15 +12:00
parent bd171f3220
commit 1ee4205703

View File

@@ -112,8 +112,12 @@ public class SimpleMapConverterTest {
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
() -> simpleMapConverter.init()); () -> simpleMapConverter.init());
// Get path separator used for this platform (eg. / for Linux, \ for Windows)
String separator = File.separator;
assertThat(exception.getMessage(), assertThat(exception.getMessage(),
is("An error occurs parsing " + dspaceDir.getAbsolutePath() + "/config/crosswalks/test.properties")); is("An error occurs parsing " + dspaceDir.getAbsolutePath() + separator + "config" + separator
+ "crosswalks" + separator + "test.properties"));
Throwable cause = exception.getCause(); Throwable cause = exception.getCause();
assertThat(cause, notNullValue()); assertThat(cause, notNullValue());