Use getPath instead of URI
@@ -15,6 +15,7 @@ import java.io.IOException;
import java.io.Writer;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -62,13 +63,9 @@ public class FreeMarkerTemplateProcessorTest {
@Test
- public void canProcessTemplate() throws URISyntaxException, IOException {
+ public void canProcessTemplate() throws IOException {
Path generatedFilePath = Paths.get(testFolder.getRoot().toString(), TEST_GENERATED_FILE);
-
- URI expectedContentFileUrl = ClassLoader.getSystemResource("result.txt").toURI();
- assertNotNull(expectedContentFileUrl);
-
- Path expectedContentFilePath = Paths.get(expectedContentFileUrl.getPath());
+ Path expectedContentFilePath = Paths.get(ClassLoader.getSystemResource("result.txt").getPath());
Writer writer = FreeMarkerTemplateProcessor.createFileWriter(generatedFilePath.toAbsolutePath().toString());
Template template = FreeMarkerTemplateProcessor.getFileTemplate(TEST_TEMPLATE_FILE);
