Skip to content

Commit

Permalink
Attempt to fix some tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kwakeroni committed Dec 7, 2018
1 parent 3cf4e57 commit de9a8db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions parameters-application/parameters-standalone-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
<groupId>be.kwakeroni.parameters.management</groupId>
<artifactId>parameters-management-rest</artifactId>
</dependency>
<dependency>
<groupId>be.kwakeroni.parameters.management</groupId>
<artifactId>parameters-management-web</artifactId>
</dependency>
<dependency>
<groupId>be.kwakeroni.parameters.adapter</groupId>
<artifactId>parameters-adapter-direct</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import be.kwakeroni.parameters.backend.api.Configuration;
import be.kwakeroni.parameters.backend.api.ConfigurationProvider;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -14,6 +15,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -32,6 +34,8 @@
@ExtendWith(MockitoExtension.class)
class ServerConfigurationProviderTest {

private static final boolean SUPPORTS_POSIX = FileSystems.getDefault().supportedFileAttributeViews().contains("posix");

@AfterEach
void cleanup() {
ServerConfigurationProvider.clear();
Expand Down Expand Up @@ -79,6 +83,7 @@ void testFileConfig() throws Exception {
@Test
@DisplayName("Survives unreadable properties file")
void testFileConfigUnreadable() throws Exception {
Assumptions.assumeTrue(SUPPORTS_POSIX, "File system does not support Posix");
Path file = Paths.get("business-parameters.properties");
try {
Files.write(file, Collections.singleton("property=testFileConfigUnreadable"));
Expand Down Expand Up @@ -128,6 +133,7 @@ void testClasspathConfig() {
@Test
@DisplayName("Survives unreadable properties file on classpath")
void testClasspathConfigUnreadable() throws Exception {
Assumptions.assumeTrue(SUPPORTS_POSIX, "File system does not support Posix");
String pathPrefix = this.getClass().getName().replace('.', '/') + "/testClasspathConfigUnreadable/";
ClassLoader original = Thread.currentThread().getContextClassLoader();
Path path = Paths.get(original.getResource(pathPrefix + "business-parameters.properties").toURI());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void readsDifferentEncoding() throws Exception {

@Test
public void propagatesIOExceptions() throws Exception {
FileStorage fileStorage = new FileStorage(Paths.get("not://existing"));
FileStorage fileStorage = new FileStorage(Paths.get("/not/existing"));

assertThatThrownBy(fileStorage::initialize)
.isInstanceOf(UncheckedIOException.class);
Expand Down

0 comments on commit de9a8db

Please sign in to comment.