From a79e865eefc09e0394b50bf9bf1f0fb88dc55b44 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 8 Jan 2025 18:40:18 +0100 Subject: [PATCH] Drop dependency on Commons IOUtils in tests --- .../java/org/openrewrite/maven/AbstractRewriteMojoTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/openrewrite/maven/AbstractRewriteMojoTest.java b/src/test/java/org/openrewrite/maven/AbstractRewriteMojoTest.java index 919fb8c4..c843fc09 100644 --- a/src/test/java/org/openrewrite/maven/AbstractRewriteMojoTest.java +++ b/src/test/java/org/openrewrite/maven/AbstractRewriteMojoTest.java @@ -15,7 +15,6 @@ */ package org.openrewrite.maven; -import org.apache.commons.io.IOUtils; import org.apache.maven.project.MavenProject; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; @@ -24,7 +23,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -48,13 +46,13 @@ public void execute() { }; if (!loc.startsWith("http")) { - Files.write(temp.resolve(loc), "rewrite".getBytes(StandardCharsets.UTF_8)); + Files.writeString(temp.resolve(loc), "rewrite"); } AbstractRewriteMojo.Config config = mojo.getConfig(); assertThat(config).isNotNull(); try (InputStream is = config.inputStream) { - assertThat(IOUtils.readLines(is, StandardCharsets.UTF_8)).isNotEmpty(); + assertThat(is.readAllBytes()).isNotEmpty(); } } }