You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/01/29 14:16:56 UTC
(commons-cli) branch master updated: Use assertThrows()
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-cli.git
The following commit(s) were added to refs/heads/master by this push:
new bf2264e Use assertThrows()
bf2264e is described below
commit bf2264eb0d811c7146f89abd931fe006fe6a93cc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jan 29 09:16:53 2024 -0500
Use assertThrows()
---
src/test/java/org/apache/commons/cli/AbstractParserTestCase.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java b/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java
index c4c0662..9f0b23e 100644
--- a/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java
+++ b/src/test/java/org/apache/commons/cli/AbstractParserTestCase.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Arrays;
import java.util.List;
@@ -60,12 +61,11 @@ public abstract class AbstractParserTestCase {
//@formatter:on
}
- @Test(expected = UnrecognizedOptionException.class)
public void testAmbiguousArgParsing() throws Exception {
- final String[] args = {"-=-"};
+ final String[] args = { "-=-" };
final Options options = new Options();
- final CommandLine cl = parser.parse(options, args);
+ assertThrows(UnrecognizedOptionException.class, () -> parser.parse(options, args));
}
@Test