We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6932cec commit 6f82a1fCopy full SHA for 6f82a1f
1 file changed
src/test/java/org/apache/commons/cli/bug/BugCLI252Test.java
@@ -24,6 +24,8 @@
24
import org.apache.commons.cli.ParseException;
25
import org.junit.Test;
26
27
+import static org.junit.jupiter.api.Assertions.assertThrows;
28
+
29
public class BugCLI252Test {
30
31
private Options getOptions() {
@@ -33,9 +35,11 @@ private Options getOptions() {
33
35
return options;
34
36
}
37
- @Test(expected = AmbiguousOptionException.class)
- public void testAmbiquousOptionName() throws ParseException {
38
- new DefaultParser().parse(getOptions(), new String[] {"--pref"});
+ @Test
39
+ public void testAmbiquousOptionName() {
40
+ assertThrows(AmbiguousOptionException.class, () ->
41
+ new DefaultParser().parse(getOptions(), new String[]{"--pref"})
42
+ );
43
44
45
@Test
0 commit comments