diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 10599bea279..ae39dd12f11 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -36,7 +36,9 @@
-
+
+
+
diff --git a/smithy-aws-apigateway-openapi/src/test/java/software/amazon/smithy/aws/apigateway/openapi/CloudFormationSubstitutionTest.java b/smithy-aws-apigateway-openapi/src/test/java/software/amazon/smithy/aws/apigateway/openapi/CloudFormationSubstitutionTest.java
index 46d7b064994..0c720325d3c 100644
--- a/smithy-aws-apigateway-openapi/src/test/java/software/amazon/smithy/aws/apigateway/openapi/CloudFormationSubstitutionTest.java
+++ b/smithy-aws-apigateway-openapi/src/test/java/software/amazon/smithy/aws/apigateway/openapi/CloudFormationSubstitutionTest.java
@@ -34,7 +34,7 @@ public void performsSubstitutionsByDefault() {
.unwrap();
ObjectNode expected = Node.parse(
- IoUtils.readUtf8File(getClass().getResource("substitution-performed.json").getPath()))
+ IoUtils.readUtf8Resource(getClass(), "substitution-performed.json"))
.expectObjectNode();
OpenApiConfig config = new OpenApiConfig();
config.setService(ShapeId.from("example.smithy#MyService"));
@@ -55,7 +55,7 @@ public void pluginCanBeDisabled() {
.unwrap();
ObjectNode expected = Node.parse(
- IoUtils.readUtf8File(getClass().getResource("substitution-not-performed.json").getPath()))
+ IoUtils.readUtf8Resource(getClass(), "substitution-not-performed.json"))
.expectObjectNode();
OpenApiConfig config = new OpenApiConfig();
diff --git a/smithy-build/src/main/java/software/amazon/smithy/build/plugins/SourcesPlugin.java b/smithy-build/src/main/java/software/amazon/smithy/build/plugins/SourcesPlugin.java
index dde8fe390f5..22c3072708d 100644
--- a/smithy-build/src/main/java/software/amazon/smithy/build/plugins/SourcesPlugin.java
+++ b/smithy-build/src/main/java/software/amazon/smithy/build/plugins/SourcesPlugin.java
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
+import java.util.stream.Collectors;
import software.amazon.smithy.build.FileManifest;
import software.amazon.smithy.build.PluginContext;
import software.amazon.smithy.build.SmithyBuildPlugin;
@@ -91,7 +92,9 @@ public void execute(PluginContext context) {
LOGGER.info(String.format("Skipping `%s` manifest because no Smithy sources found", projectionName));
} else {
LOGGER.fine(() -> String.format("Writing `%s` manifest", projectionName));
- context.getFileManifest().writeFile("manifest", String.join("\n", names) + "\n");
+ // Normalize filenames to Unix style.
+ String manifest = names.stream().map(name -> name.replace("\\", "/")).collect(Collectors.joining("\n"));
+ context.getFileManifest().writeFile("manifest", manifest + "\n");
}
}
diff --git a/smithy-build/src/test/java/software/amazon/smithy/build/model/SmithyBuildConfigTest.java b/smithy-build/src/test/java/software/amazon/smithy/build/model/SmithyBuildConfigTest.java
index f286a550f87..a4474b2ad0c 100644
--- a/smithy-build/src/test/java/software/amazon/smithy/build/model/SmithyBuildConfigTest.java
+++ b/smithy-build/src/test/java/software/amazon/smithy/build/model/SmithyBuildConfigTest.java
@@ -25,6 +25,7 @@
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
+import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
@@ -149,6 +150,10 @@ public void rewritesArgsArrayToUnderscoreArgs() {
}
private String getResourcePath(String name) {
- return SmithyBuildTest.class.getResource(name).getPath();
+ try {
+ return Paths.get(SmithyBuildTest.class.getResource(name).toURI()).toString();
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e);
+ }
}
}
diff --git a/smithy-build/src/test/java/software/amazon/smithy/build/plugins/ConfigurableSmithyBuildPluginTest.java b/smithy-build/src/test/java/software/amazon/smithy/build/plugins/ConfigurableSmithyBuildPluginTest.java
index 34f0b7f690a..b3801c0971e 100644
--- a/smithy-build/src/test/java/software/amazon/smithy/build/plugins/ConfigurableSmithyBuildPluginTest.java
+++ b/smithy-build/src/test/java/software/amazon/smithy/build/plugins/ConfigurableSmithyBuildPluginTest.java
@@ -14,7 +14,7 @@ public class ConfigurableSmithyBuildPluginTest {
@Test
public void loadsConfigurationClass() {
Model model = Model.assembler()
- .addImport(getClass().getResource("sources/a.smithy").getPath())
+ .addImport(getClass().getResource("sources/a.smithy"))
.assemble()
.unwrap();
MockManifest manifest = new MockManifest();
diff --git a/smithy-build/src/test/java/software/amazon/smithy/build/plugins/SourcesPluginTest.java b/smithy-build/src/test/java/software/amazon/smithy/build/plugins/SourcesPluginTest.java
index 906aef3b8b2..03f0232e7e7 100644
--- a/smithy-build/src/test/java/software/amazon/smithy/build/plugins/SourcesPluginTest.java
+++ b/smithy-build/src/test/java/software/amazon/smithy/build/plugins/SourcesPluginTest.java
@@ -5,6 +5,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
+import java.net.URISyntaxException;
import java.nio.file.Paths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -18,10 +19,10 @@
public class SourcesPluginTest {
@Test
- public void copiesFilesForSourceProjection() {
+ public void copiesFilesForSourceProjection() throws URISyntaxException {
Model model = Model.assembler()
- .addImport(getClass().getResource("sources/a.smithy").getPath())
- .addImport(getClass().getResource("sources/b.smithy").getPath())
+ .addImport(getClass().getResource("sources/a.smithy"))
+ .addImport(getClass().getResource("sources/b.smithy"))
.addImport(getClass().getResource("sources/c/c.json"))
.addImport(getClass().getResource("notsources/d.smithy"))
.assemble()
@@ -31,10 +32,12 @@ public void copiesFilesForSourceProjection() {
.fileManifest(manifest)
.model(model)
.originalModel(model)
- .sources(ListUtils.of(Paths.get(getClass().getResource("sources/a.smithy").getPath()).getParent()))
+ .sources(ListUtils.of(Paths.get(getClass().getResource("sources/a.smithy").toURI()).getParent()))
.build();
new SourcesPlugin().execute(context);
String manifestString = manifest.getFileString("manifest").get();
+ // Normalize for Windows.
+ manifestString = manifestString.replace("\\", "/");
assertThat(manifestString, containsString("a.smithy\n"));
assertThat(manifestString, containsString("b.smithy\n"));
@@ -46,9 +49,9 @@ public void copiesFilesForSourceProjection() {
}
@Test
- public void copiesModelFromJarWithSourceProjection() {
+ public void copiesModelFromJarWithSourceProjection() throws URISyntaxException {
Model model = Model.assembler()
- .addImport(getClass().getResource("sources/jar-import.jar").getPath())
+ .addImport(getClass().getResource("sources/jar-import.jar"))
.addImport(getClass().getResource("notsources/d.smithy"))
.assemble()
.unwrap();
@@ -57,10 +60,12 @@ public void copiesModelFromJarWithSourceProjection() {
.fileManifest(manifest)
.model(model)
.originalModel(model)
- .sources(ListUtils.of(Paths.get(getClass().getResource("sources/jar-import.jar").getPath())))
+ .sources(ListUtils.of(Paths.get(getClass().getResource("sources/jar-import.jar").toURI())))
.build();
new SourcesPlugin().execute(context);
String manifestString = manifest.getFileString("manifest").get();
+ // Normalize for Windows.
+ manifestString = manifestString.replace("\\", "/");
assertThat(manifestString, containsString("jar-import/a.smithy\n"));
assertThat(manifestString, containsString("jar-import/b/b.smithy\n"));
@@ -72,9 +77,9 @@ public void copiesModelFromJarWithSourceProjection() {
}
@Test
- public void copiesModelFromJarWithNonSourceProjection() {
+ public void copiesModelFromJarWithNonSourceProjection() throws URISyntaxException {
Model model = Model.assembler()
- .addImport(getClass().getResource("sources/jar-import.jar").getPath())
+ .addImport(getClass().getResource("sources/jar-import.jar"))
.addImport(getClass().getResource("notsources/d.smithy"))
.assemble()
.unwrap();
@@ -85,10 +90,12 @@ public void copiesModelFromJarWithNonSourceProjection() {
.projection("foo", projection)
.model(model)
.originalModel(model)
- .sources(ListUtils.of(Paths.get(getClass().getResource("sources/jar-import.jar").getPath())))
+ .sources(ListUtils.of(Paths.get(getClass().getResource("sources/jar-import.jar").toURI())))
.build();
new SourcesPlugin().execute(context);
String manifestString = manifest.getFileString("manifest").get();
+ // Normalize for Windows.
+ manifestString = manifestString.replace("\\", "/");
assertThat(manifestString, containsString("model.json"));
assertThat(manifestString, not(containsString("jar-import")));
@@ -98,11 +105,11 @@ public void copiesModelFromJarWithNonSourceProjection() {
}
@Test
- public void copiesOnlyFilesFromSourcesForProjection() {
+ public void copiesOnlyFilesFromSourcesForProjection() throws URISyntaxException {
Model model = Model.assembler()
- .addImport(getClass().getResource("sources/a.smithy").getPath())
- .addImport(getClass().getResource("sources/b.smithy").getPath())
- .addImport(getClass().getResource("sources/c/c.json").getPath())
+ .addImport(getClass().getResource("sources/a.smithy"))
+ .addImport(getClass().getResource("sources/b.smithy"))
+ .addImport(getClass().getResource("sources/c/c.json"))
.addImport(getClass().getResource("notsources/d.smithy"))
.assemble()
.unwrap();
@@ -113,7 +120,7 @@ public void copiesOnlyFilesFromSourcesForProjection() {
.fileManifest(manifest)
.model(model)
.originalModel(model)
- .sources(ListUtils.of(Paths.get(getClass().getResource("sources/a.smithy").getPath()).getParent()))
+ .sources(ListUtils.of(Paths.get(getClass().getResource("sources/a.smithy").toURI()).getParent()))
.build();
new SourcesPlugin().execute(context);
String manifestString = manifest.getFileString("manifest").get();
@@ -135,7 +142,7 @@ public void copiesOnlyFilesFromSourcesForProjection() {
}
@Test
- public void treatsNewlyAddedShapesAsNewSources() {
+ public void treatsNewlyAddedShapesAsNewSources() throws URISyntaxException {
Model originalModel = Model.assembler().assemble().unwrap();
Model newModel = Model.assembler()
.addShape(StringShape.builder().id("a.b#MyString").build())
@@ -148,7 +155,7 @@ public void treatsNewlyAddedShapesAsNewSources() {
.fileManifest(manifest)
.originalModel(originalModel)
.model(newModel)
- .sources(ListUtils.of(Paths.get(getClass().getResource("sources/a.smithy").getPath()).getParent()))
+ .sources(ListUtils.of(Paths.get(getClass().getResource("sources/a.smithy").toURI()).getParent()))
.build();
new SourcesPlugin().execute(context);
String modelString = manifest.getFileString("model.json").get();
@@ -157,10 +164,10 @@ public void treatsNewlyAddedShapesAsNewSources() {
}
@Test
- public void doesNotAllowConflicts() {
+ public void doesNotAllowConflicts() throws URISyntaxException {
Model model = Model.assembler()
- .addImport(getClass().getResource("sources/a.smithy").getPath())
- .addImport(getClass().getResource("conflicting/a.smithy").getPath())
+ .addImport(getClass().getResource("sources/a.smithy"))
+ .addImport(getClass().getResource("conflicting/a.smithy"))
.assemble()
.unwrap();
MockManifest manifest = new MockManifest();
@@ -169,8 +176,8 @@ public void doesNotAllowConflicts() {
.model(model)
.originalModel(model)
.sources(ListUtils.of(
- Paths.get(getClass().getResource("sources/a.smithy").getPath()),
- Paths.get(getClass().getResource("conflicting/a.smithy").getPath())))
+ Paths.get(getClass().getResource("sources/a.smithy").toURI()),
+ Paths.get(getClass().getResource("conflicting/a.smithy").toURI())))
.build();
Assertions.assertThrows(SourcesConflictException.class, () -> new SourcesPlugin().execute(context));
diff --git a/smithy-cli/src/test/java/software/amazon/smithy/cli/BuildParameterBuilderTest.java b/smithy-cli/src/test/java/software/amazon/smithy/cli/BuildParameterBuilderTest.java
index 1fa5a0178f1..7f5b31a5575 100644
--- a/smithy-cli/src/test/java/software/amazon/smithy/cli/BuildParameterBuilderTest.java
+++ b/smithy-cli/src/test/java/software/amazon/smithy/cli/BuildParameterBuilderTest.java
@@ -9,6 +9,8 @@
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
+import java.net.URISyntaxException;
+import java.nio.file.Paths;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -38,8 +40,8 @@ public void skipsMissingConfigFiles() {
}
@Test
- public void addsConfigFilesWhenFound() {
- String configFile = getClass().getResource("smithy-build-a.json").getPath();
+ public void addsConfigFilesWhenFound() throws URISyntaxException {
+ String configFile = Paths.get(getClass().getResource("smithy-build-a.json").toURI()).toString();
BuildParameterBuilder.Result result = new BuildParameterBuilder()
.addConfigIfExists(configFile)
.build();
@@ -213,10 +215,10 @@ public void projectionBuildTaggedSourcesRemovedFromModelDiscovery() {
}
@Test
- public void findsProjectionJarsWithSourceTags() {
- String a = getClass().getResource("jars/a/a.jar").getPath();
- String b = getClass().getResource("jars/b/b.jar").getPath();
- String c = getClass().getResource("jars/c/c.jar").getPath();
+ public void findsProjectionJarsWithSourceTags() throws URISyntaxException {
+ String a = Paths.get(getClass().getResource("jars/a/a.jar").toURI()).toString();
+ String b = Paths.get(getClass().getResource("jars/b/b.jar").toURI()).toString();
+ String c = Paths.get(getClass().getResource("jars/c/c.jar").toURI()).toString();
String separator = System.getProperty("path.separator");
String buildCp = a + separator + b + separator + c;
@@ -237,14 +239,14 @@ public void findsProjectionJarsWithSourceTags() {
}
@Test
- public void usesCustomSeparator() {
+ public void usesCustomSeparator() throws URISyntaxException {
String currentSeparator = System.getProperty("path.separator");
try {
System.setProperty("path.separator", "|");
- String a = getClass().getResource("jars/a/a.jar").getPath();
- String b = getClass().getResource("jars/b/b.jar").getPath();
- String c = getClass().getResource("jars/c/c.jar").getPath();
+ String a = Paths.get(getClass().getResource("jars/a/a.jar").toURI()).toString();
+ String b = Paths.get(getClass().getResource("jars/b/b.jar").toURI()).toString();
+ String c = Paths.get(getClass().getResource("jars/c/c.jar").toURI()).toString();
String buildCp = a + "|" + b + "|" + c;
BuildParameterBuilder.Result result = new BuildParameterBuilder()
diff --git a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/AstCommandTest.java b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/AstCommandTest.java
index e7f5b34199f..1cd26205f84 100644
--- a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/AstCommandTest.java
+++ b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/AstCommandTest.java
@@ -5,6 +5,8 @@
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
+import java.net.URISyntaxException;
+import java.nio.file.Paths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import software.amazon.smithy.cli.CliError;
@@ -31,7 +33,7 @@ public void usesModelDiscoveryWithCustomValidClasspath() throws Exception {
PrintStream printStream = new PrintStream(outputStream);
System.setOut(printStream);
- String dir = getClass().getResource("valid.jar").getPath();
+ String dir = Paths.get(getClass().getResource("valid.jar").toURI()).toString();
SmithyCli.create().run("ast", "--debug", "--discover-classpath", dir);
System.setOut(out);
@@ -42,7 +44,7 @@ public void usesModelDiscoveryWithCustomValidClasspath() throws Exception {
@Test
public void usesModelDiscoveryWithCustomInvalidClasspath() {
CliError e = Assertions.assertThrows(CliError.class, () -> {
- String dir = getClass().getResource("invalid.jar").getPath();
+ String dir = Paths.get(getClass().getResource("invalid.jar").toURI()).toString();
SmithyCli.create().run("ast", "--debug", "--discover-classpath", dir);
});
@@ -60,8 +62,8 @@ public void failsOnUnknownTrait() {
}
@Test
- public void allowsUnknownTrait() {
- String model = getClass().getResource("unknown-trait.smithy").getPath();
+ public void allowsUnknownTrait() throws URISyntaxException {
+ String model = Paths.get(getClass().getResource("unknown-trait.smithy").toURI()).toString();
SmithyCli.create().run("ast", "--allow-unknown-traits", model);
}
}
diff --git a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/BuildCommandTest.java b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/BuildCommandTest.java
index 2fd27f199ae..253f8894be9 100644
--- a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/BuildCommandTest.java
+++ b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/BuildCommandTest.java
@@ -20,6 +20,7 @@
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
+import java.nio.file.Paths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import software.amazon.smithy.cli.CliError;
@@ -47,7 +48,7 @@ public void dumpsOutValidationErrorsAndFails() throws Exception {
System.setOut(printStream);
CliError e = Assertions.assertThrows(CliError.class, () -> {
- String model = getClass().getResource("unknown-trait.smithy").getPath();
+ String model = Paths.get(getClass().getResource("unknown-trait.smithy").toURI()).toString();
SmithyCli.create().run("build", model);
});
@@ -61,7 +62,7 @@ public void dumpsOutValidationErrorsAndFails() throws Exception {
@Test
public void printsSuccessfulProjections() throws Exception {
- String model = getClass().getResource("valid-model.smithy").getPath();
+ String model = Paths.get(getClass().getResource("valid-model.smithy").toURI()).toString();
PrintStream out = System.out;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -83,8 +84,8 @@ public void validationFailuresCausedByProjectionsAreDetected() throws Exception
System.setOut(printStream);
CliError e = Assertions.assertThrows(CliError.class, () -> {
- String model = getClass().getResource("valid-model.smithy").getPath();
- String config = getClass().getResource("projection-build-failure.json").getPath();
+ String model = Paths.get(getClass().getResource("valid-model.smithy").toURI()).toString();
+ String config = Paths.get(getClass().getResource("projection-build-failure.json").toURI()).toString();
SmithyCli.create().run("build", "--debug", "--config", config, model);
});
diff --git a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/SelectCommandTest.java b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/SelectCommandTest.java
index a15fbd01fad..fb080667b0c 100644
--- a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/SelectCommandTest.java
+++ b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/SelectCommandTest.java
@@ -8,6 +8,7 @@
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
+import java.nio.file.Paths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import software.amazon.smithy.cli.CliError;
@@ -44,7 +45,7 @@ public void dumpsOutValidationErrorsAndFails() throws Exception {
System.setOut(outPrintStream);
CliError e = Assertions.assertThrows(CliError.class, () -> {
- String model = getClass().getResource("unknown-trait.smithy").getPath();
+ String model = Paths.get(getClass().getResource("unknown-trait.smithy").toURI()).toString();
SmithyCli.create().run("select", "--selector", "string", model);
});
@@ -64,7 +65,7 @@ public void dumpsOutValidationErrorsAndFails() throws Exception {
@Test
public void printsSuccessfulMatchesToStdout() throws Exception {
- String model = getClass().getResource("valid-model.smithy").getPath();
+ String model = Paths.get(getClass().getResource("valid-model.smithy").toURI()).toString();
PrintStream out = System.out;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -82,7 +83,7 @@ public void printsSuccessfulMatchesToStdout() throws Exception {
@Test
public void printsJsonVarsToStdout() throws Exception {
- String model = getClass().getResource("valid-model.smithy").getPath();
+ String model = Paths.get(getClass().getResource("valid-model.smithy").toURI()).toString();
// Take over stdout.
PrintStream out = System.out;
@@ -101,7 +102,7 @@ public void printsJsonVarsToStdout() throws Exception {
@Test
public void readsSelectorFromStdinToo() throws Exception {
- String model = getClass().getResource("valid-model.smithy").getPath();
+ String model = Paths.get(getClass().getResource("valid-model.smithy").toURI()).toString();
// Send the selector through input stream.
InputStream in = System.in;
diff --git a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/ValidateCommandTest.java b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/ValidateCommandTest.java
index b2681d85441..9b967762ea6 100644
--- a/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/ValidateCommandTest.java
+++ b/smithy-cli/src/test/java/software/amazon/smithy/cli/commands/ValidateCommandTest.java
@@ -20,6 +20,8 @@
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
+import java.net.URISyntaxException;
+import java.nio.file.Paths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import software.amazon.smithy.cli.CliError;
@@ -40,15 +42,15 @@ public void hasValidateCommand() throws Exception {
}
@Test
- public void usesModelDiscoveryWithCustomValidClasspath() {
- String dir = getClass().getResource("valid.jar").getPath();
+ public void usesModelDiscoveryWithCustomValidClasspath() throws URISyntaxException {
+ String dir = Paths.get(getClass().getResource("valid.jar").toURI()).toString();
SmithyCli.create().run("validate", "--debug", "--discover-classpath", dir);
}
@Test
public void usesModelDiscoveryWithCustomInvalidClasspath() {
CliError e = Assertions.assertThrows(CliError.class, () -> {
- String dir = getClass().getResource("invalid.jar").getPath();
+ String dir = Paths.get(getClass().getResource("invalid.jar").toURI()).toString();
SmithyCli.create().run("validate", "--debug", "--discover-classpath", dir);
});
@@ -58,7 +60,7 @@ public void usesModelDiscoveryWithCustomInvalidClasspath() {
@Test
public void failsOnUnknownTrait() {
CliError e = Assertions.assertThrows(CliError.class, () -> {
- String model = getClass().getResource("unknown-trait.smithy").getPath();
+ String model = Paths.get(getClass().getResource("unknown-trait.smithy").toURI()).toString();
SmithyCli.create().run("validate", model);
});
@@ -66,8 +68,8 @@ public void failsOnUnknownTrait() {
}
@Test
- public void allowsUnknownTrait() {
- String model = getClass().getResource("unknown-trait.smithy").getPath();
+ public void allowsUnknownTrait() throws URISyntaxException {
+ String model = Paths.get(getClass().getResource("unknown-trait.smithy").toURI()).toString();
SmithyCli.create().run("validate", "--allow-unknown-traits", model);
}
}
diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/node/DefaultNodeWriterTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/node/DefaultNodeWriterTest.java
index bafd4e05372..d03d1297141 100644
--- a/smithy-model/src/test/java/software/amazon/smithy/model/node/DefaultNodeWriterTest.java
+++ b/smithy-model/src/test/java/software/amazon/smithy/model/node/DefaultNodeWriterTest.java
@@ -42,21 +42,21 @@ public static Collection