Cleanup paths to fix tests running on Windows

pull/20874/head
Phillip Webb 5 years ago
parent baa728c85e
commit 5b374e833b

@ -28,6 +28,8 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.util.StringUtils;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
@ -81,7 +83,7 @@ class PrivateKeyParserTests {
void parseWithInvalidPathWillThrowException() throws URISyntaxException { void parseWithInvalidPathWillThrowException() throws URISyntaxException {
URI privateKeyPath = new URI("file:///bad/path/key.pem"); URI privateKeyPath = new URI("file:///bad/path/key.pem");
assertThatIllegalStateException().isThrownBy(() -> PrivateKeyParser.parse(Paths.get(privateKeyPath))) assertThatIllegalStateException().isThrownBy(() -> PrivateKeyParser.parse(Paths.get(privateKeyPath)))
.withMessageContaining(privateKeyPath.getPath()); .withMessageContaining(StringUtils.cleanPath(privateKeyPath.getPath()));
} }
} }

Loading…
Cancel
Save