Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): JSON-LD Unit tests fail on Windows #3670

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
Expand Down Expand Up @@ -51,7 +52,7 @@ void verifyCachedDocsFromConfig_oneValidEntry(ServiceExtensionContext context, J
DocumentLoader documentLoader = getFieldValue("documentLoader", service);
Map<String, URI> cache = getFieldValue("uriCache", documentLoader);

assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"));
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI());
}

@Test
Expand All @@ -67,7 +68,7 @@ void verifyCachedDocsFromConfig_oneValidEntry_withSuperfluous(ServiceExtensionCo
DocumentLoader documentLoader = getFieldValue("documentLoader", service);
Map<String, URI> cache = getFieldValue("uriCache", documentLoader);

assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"));
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI());
}

@Test
Expand All @@ -84,8 +85,8 @@ void verifyCachedDocsFromConfig_multipleValidEntries(ServiceExtensionContext con
DocumentLoader documentLoader = getFieldValue("documentLoader", service);
Map<String, URI> cache = getFieldValue("uriCache", documentLoader);

assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"));
assertThat(cache).containsEntry("http://bar.org/doc.json", new URI("file:/tmp/bar/doc.json"));
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI());
assertThat(cache).containsEntry("http://bar.org/doc.json", new File("/tmp/bar/doc.json").toURI());
}

@Test
Expand All @@ -101,7 +102,7 @@ void verifyCachedDocsFromConfig_multipleEntries_oneIncomplete(ServiceExtensionCo
DocumentLoader documentLoader = getFieldValue("documentLoader", service);
Map<String, URI> cache = getFieldValue("uriCache", documentLoader);

assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"))
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI())
.noneSatisfy((s, uri) -> assertThat(s).isEqualTo("http://bar.org/doc.json"));

}
Expand All @@ -119,7 +120,7 @@ void verifyCachedDocsFromConfig_multipleEntries_oneInvalid(ServiceExtensionConte
DocumentLoader documentLoader = getFieldValue("documentLoader", service);
Map<String, URI> cache = getFieldValue("uriCache", documentLoader);

assertThat(cache).containsEntry("http://foo.org/doc.json", new URI("file:/tmp/foo/doc.json"))
assertThat(cache).containsEntry("http://foo.org/doc.json", new File("/tmp/foo/doc.json").toURI())
.noneSatisfy((s, uri) -> assertThat(s).isEqualTo("http://bar.org/doc.json"));

}
Expand Down
Loading