File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
2323import static org .junit .Assert .assertNotNull ;
2424import static org .junit .Assert .assertTrue ;
2525import static org .junit .Assert .fail ;
26+ import static org .junit .jupiter .api .Assertions .assertThrows ;
2627
2728import java .util .Arrays ;
2829import java .util .List ;
@@ -60,12 +61,11 @@ public void setUp() {
6061 //@formatter:on
6162 }
6263
63- @ Test (expected = UnrecognizedOptionException .class )
6464 public void testAmbiguousArgParsing () throws Exception {
65- final String [] args = {"-=-" };
65+ final String [] args = { "-=-" };
6666 final Options options = new Options ();
6767
68- final CommandLine cl = parser .parse (options , args );
68+ assertThrows ( UnrecognizedOptionException . class , () -> parser .parse (options , args ) );
6969 }
7070
7171 @ Test
You can’t perform that action at this time.
0 commit comments