File tree Expand file tree Collapse file tree
test/src/test/java/org/apache/commons/proxy2/stub Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import static org .junit .Assert .assertEquals ;
2222import static org .junit .Assert .assertNotNull ;
2323import static org .junit .Assert .assertNull ;
24+ import static org .junit .jupiter .api .Assertions .assertThrows ;
2425
2526import java .util .Collections ;
2627import java .util .HashMap ;
@@ -137,11 +138,12 @@ protected void train(CustomAnnotation trainee)
137138 assertArrayEquals (new FiniteValues [] { FiniteValues .TWO }, nestingAnnotation .children ()[1 ].finiteValues ());
138139 }
139140
140- @ Test ( expected = IllegalArgumentException . class )
141+ @ Test
141142 public void testBadMemberMap ()
142143 {
143- AnnotationBuilder .of (CustomAnnotation .class ).withMembers (
144- Collections .singletonMap ("annString" , Integer .valueOf (100 )));
144+ assertThrows (IllegalArgumentException .class , () ->
145+ AnnotationBuilder .of (CustomAnnotation .class ).withMembers (
146+ Collections .singletonMap ("annString" , Integer .valueOf (100 ))));
145147 }
146148
147149 public @interface NestingAnnotation
@@ -167,4 +169,4 @@ public enum FiniteValues
167169 ONE , TWO , THREE ;
168170 }
169171
170- }
172+ }
You can’t perform that action at this time.
0 commit comments