This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
The following commit(s) were added to refs/heads/master by this push:
new 5b411b6 CODEC-285 Better StringEncoderAbstractTest testEncodeNull
(#41)
5b411b6 is described below
commit 5b411b6db5bb8a9addbe700ac8d05cf63f1ff214
Author: John Patrick <[email protected]>
AuthorDate: Thu Feb 17 15:00:42 2022 +0000
CODEC-285 Better StringEncoderAbstractTest testEncodeNull (#41)
* CODEC-284 update to hamcrest v2.2
* CODEC-285 update to junit v5.6.0
* CODEC-285 update to junit v5.8.2 via junit-bom
* StringEncoderAbstractTest.testEncodeNull no test actually throw
EncoderException
---
pom.xml | 3 +++
.../apache/commons/codec/StringEncoderAbstractTest.java | 14 ++++++++------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9d7afd6..83c7757 100644
--- a/pom.xml
+++ b/pom.xml
@@ -274,6 +274,9 @@ limitations under the License.
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
+ <!-- Fix to build on JDK 7: version 4.0.0 requires Java 8. -->
+ <!-- Can be dropped when CP 49 is released -->
+ <commons.felix.version>3.5.1</commons.felix.version>
<commons.componentid>codec</commons.componentid>
<commons.module.name>org.apache.commons.codec</commons.module.name>
<commons.jira.id>CODEC</commons.jira.id>
diff --git
a/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java
b/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java
index a7b3a85..d13a684 100644
--- a/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java
+++ b/src/test/java/org/apache/commons/codec/StringEncoderAbstractTest.java
@@ -21,6 +21,12 @@ import java.util.Locale;
import org.junit.Assert;
import org.junit.Test;
+import org.junit.jupiter.api.function.Executable;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
*/
@@ -59,13 +65,9 @@ public abstract class StringEncoderAbstractTest<T extends
StringEncoder> {
}
@Test
- public void testEncodeNull() throws Exception {
+ public void testEncodeNull() throws EncoderException {
final StringEncoder encoder = this.getStringEncoder();
- try {
- encoder.encode(null);
- } catch (final EncoderException ee) {
- // An exception should be thrown
- }
+ encoder.encode(null);
}
@Test