|
53 | 53 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
54 | 54 | import static org.assertj.core.api.Assertions.assertThat;
|
55 | 55 | import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
| 56 | +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; |
56 | 57 | import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
57 | 58 | import static org.assertj.core.api.Assertions.entry;
|
58 | 59 |
|
|
73 | 74 | */
|
74 | 75 | class MergedAnnotationsTests {
|
75 | 76 |
|
| 77 | + @Test |
| 78 | + void fromPreconditions() { |
| 79 | + SearchStrategy strategy = SearchStrategy.DIRECT; |
| 80 | + RepeatableContainers containers = RepeatableContainers.standardRepeatables(); |
| 81 | + |
| 82 | + assertThatIllegalArgumentException() |
| 83 | + .isThrownBy(() -> MergedAnnotations.from(getClass(), strategy, null, AnnotationFilter.PLAIN)) |
| 84 | + .withMessage("RepeatableContainers must not be null"); |
| 85 | + assertThatIllegalArgumentException() |
| 86 | + .isThrownBy(() -> MergedAnnotations.from(getClass(), strategy, containers, null)) |
| 87 | + .withMessage("AnnotationFilter must not be null"); |
| 88 | + |
| 89 | + assertThatIllegalArgumentException() |
| 90 | + .isThrownBy(() -> MergedAnnotations.from(getClass(), new Annotation[0], null, AnnotationFilter.PLAIN)) |
| 91 | + .withMessage("RepeatableContainers must not be null"); |
| 92 | + assertThatIllegalArgumentException() |
| 93 | + .isThrownBy(() -> MergedAnnotations.from(getClass(), new Annotation[0], containers, null)) |
| 94 | + .withMessage("AnnotationFilter must not be null"); |
| 95 | + } |
| 96 | + |
76 | 97 | @Test
|
77 | 98 | void streamWhenFromNonAnnotatedClass() {
|
78 | 99 | assertThat(MergedAnnotations.from(NonAnnotatedClass.class).
|
|
0 commit comments