This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-script-interpreter.git
The following commit(s) were added to refs/heads/master by this push:
new 1f84715 JUnit Jupiter best practices (#179)
1f84715 is described below
commit 1f84715ac0a9af676617b01a028d08cc0ce5fc38
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Nov 10 04:07:09 2025 +0100
JUnit Jupiter best practices (#179)
Co-authored-by: Moderne <[email protected]>
---
.../BeanShellScriptInterpreterTest.java | 4 ++--
.../shared/scriptinterpreter/FileLoggerTest.java | 11 +++++------
.../GroovyScriptInterpreterTest.java | 8 ++++----
.../shared/scriptinterpreter/ScriptRunnerTest.java | 22 +++++++++++-----------
4 files changed, 22 insertions(+), 23 deletions(-)
diff --git
a/src/test/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreterTest.java
b/src/test/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreterTest.java
index b00a4cb..eaa5192 100644
---
a/src/test/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreterTest.java
+++
b/src/test/java/org/apache/maven/shared/scriptinterpreter/BeanShellScriptInterpreterTest.java
@@ -34,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
class BeanShellScriptInterpreterTest {
@Test
- void testEvaluateScript() throws Exception {
+ void evaluateScript() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (ScriptInterpreter interpreter = new BeanShellScriptInterpreter())
{
assertEquals(
@@ -45,7 +45,7 @@ class BeanShellScriptInterpreterTest {
}
@Test
- void testEvaluateScriptVars() throws Exception {
+ void evaluateScriptVars() throws Exception {
Map<String, Object> vars = new HashMap<>();
vars.put("testVar", "data");
ByteArrayOutputStream out = new ByteArrayOutputStream();
diff --git
a/src/test/java/org/apache/maven/shared/scriptinterpreter/FileLoggerTest.java
b/src/test/java/org/apache/maven/shared/scriptinterpreter/FileLoggerTest.java
index 2011437..dc17b96 100644
---
a/src/test/java/org/apache/maven/shared/scriptinterpreter/FileLoggerTest.java
+++
b/src/test/java/org/apache/maven/shared/scriptinterpreter/FileLoggerTest.java
@@ -19,7 +19,6 @@
package org.apache.maven.shared.scriptinterpreter;
import java.io.File;
-import java.io.IOException;
import java.nio.file.Files;
import org.junit.jupiter.api.Test;
@@ -36,7 +35,7 @@ public class FileLoggerTest {
public static final String EXPECTED_LOG = "Test1" + System.lineSeparator()
+ "Test2" + System.lineSeparator();
@Test
- public void nullOutputFileNoMirror() throws IOException {
+ void nullOutputFileNoMirror() throws Exception {
try (FileLogger fileLogger = new FileLogger(null)) {
fileLogger.consumeLine("Test1");
fileLogger.getPrintStream().println("Test2");
@@ -47,7 +46,7 @@ public class FileLoggerTest {
}
@Test
- public void nullOutputFileWithMirror() throws IOException {
+ void nullOutputFileWithMirror() throws Exception {
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
try (FileLogger fileLogger = new FileLogger(null, mirrorHandler)) {
@@ -62,7 +61,7 @@ public class FileLoggerTest {
}
@Test
- public void nullOutputFileWithMirrorWriteByte() throws IOException {
+ void nullOutputFileWithMirrorWriteByte() throws Exception {
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
try (FileLogger fileLogger = new FileLogger(null, mirrorHandler)) {
@@ -76,7 +75,7 @@ public class FileLoggerTest {
}
@Test
- public void outputFileNoMirror() throws IOException {
+ void outputFileNoMirror() throws Exception {
File outputFile = new File("target/test.log");
if (outputFile.exists()) {
outputFile.delete();
@@ -95,7 +94,7 @@ public class FileLoggerTest {
}
@Test
- public void outputFileWithMirror() throws IOException {
+ void outputFileWithMirror() throws Exception {
File outputFile = new File("target/test.log");
if (outputFile.exists()) {
outputFile.delete();
diff --git
a/src/test/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreterTest.java
b/src/test/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreterTest.java
index 0e97e2d..3bee0fa 100644
---
a/src/test/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreterTest.java
+++
b/src/test/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreterTest.java
@@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*/
class GroovyScriptInterpreterTest {
@Test
- void testEvaluateScript() throws Exception {
+ void evaluateScript() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (ScriptInterpreter interpreter = new GroovyScriptInterpreter()) {
assertEquals(
@@ -48,7 +48,7 @@ class GroovyScriptInterpreterTest {
}
@Test
- void testEvaluateScriptWithDefaultClassPath() throws Exception {
+ void evaluateScriptWithDefaultClassPath() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (ScriptInterpreter interpreter = new GroovyScriptInterpreter()) {
assertEquals(
@@ -65,7 +65,7 @@ class GroovyScriptInterpreterTest {
}
@Test
- void testEvaluateScriptWithCustomClassPath() throws Exception {
+ void evaluateScriptWithCustomClassPath() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (ScriptInterpreter interpreter = new GroovyScriptInterpreter()) {
@@ -86,7 +86,7 @@ class GroovyScriptInterpreterTest {
}
@Test
- void testEvaluateScriptVars() throws Exception {
+ void evaluateScriptVars() throws Exception {
Map<String, Object> vars = new HashMap<>();
vars.put("testVar", "data");
ByteArrayOutputStream out = new ByteArrayOutputStream();
diff --git
a/src/test/java/org/apache/maven/shared/scriptinterpreter/ScriptRunnerTest.java
b/src/test/java/org/apache/maven/shared/scriptinterpreter/ScriptRunnerTest.java
index fd94f4f..657dd7c 100644
---
a/src/test/java/org/apache/maven/shared/scriptinterpreter/ScriptRunnerTest.java
+++
b/src/test/java/org/apache/maven/shared/scriptinterpreter/ScriptRunnerTest.java
@@ -36,13 +36,13 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* @author Olivier Lamy
*/
-public class ScriptRunnerTest {
+class ScriptRunnerTest {
@TempDir
private File tempDir;
@Test
- public void testBeanshell() throws Exception {
+ void beanshell() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -62,7 +62,7 @@ public class ScriptRunnerTest {
}
@Test
- public void beanshellReturnedNullShouldBeOk() throws Exception {
+ void beanshellReturnedNullShouldBeOk() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -79,7 +79,7 @@ public class ScriptRunnerTest {
}
@Test
- public void failedBeanshellShouldCreateProperLogsMessage() throws
Exception {
+ void failedBeanshellShouldCreateProperLogsMessage() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -100,7 +100,7 @@ public class ScriptRunnerTest {
}
@Test
- public void beanshellReturnedNotTrueShouldThrowException() throws
Exception {
+ void beanshellReturnedNotTrueShouldThrowException() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -122,7 +122,7 @@ public class ScriptRunnerTest {
}
@Test
- public void testBeanshellWithFile() throws Exception {
+ void beanshellWithFile() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -141,7 +141,7 @@ public class ScriptRunnerTest {
}
@Test
- public void testGroovy() throws Exception {
+ void groovy() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -161,7 +161,7 @@ public class ScriptRunnerTest {
}
@Test
- public void groovyReturnedNullShouldBeOk() throws Exception {
+ void groovyReturnedNullShouldBeOk() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -179,7 +179,7 @@ public class ScriptRunnerTest {
}
@Test
- public void failedGroovyShouldCreateProperLogsMessage() throws Exception {
+ void failedGroovyShouldCreateProperLogsMessage() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -200,7 +200,7 @@ public class ScriptRunnerTest {
}
@Test
- public void groovyReturnedFalseShouldThrowException() throws Exception {
+ void groovyReturnedFalseShouldThrowException() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();
@@ -223,7 +223,7 @@ public class ScriptRunnerTest {
}
@Test
- public void testGroovyWithFile() throws Exception {
+ void groovyWithFile() throws Exception {
File logFile = new File(tempDir, "build.log");
TestMirrorHandler mirrorHandler = new TestMirrorHandler();