Skip to content

Commit

Permalink
Add test for invalid RetentionPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
P3ridot committed Jul 18, 2023
1 parent abeec1f commit bba15f7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DependencyInjectionUtilsTest {
void testAnnotation() {
assertThrows(DependencyInjectionException.class, () -> DependencyInjectionUtils.testAnnotation(NotAnAnnotation.class));
assertThrows(DependencyInjectionException.class, () -> DependencyInjectionUtils.testAnnotation(DefaultAnnotation.class));
assertThrows(DependencyInjectionException.class, () -> DependencyInjectionUtils.testAnnotation(ClassAnnotation.class));
assertThrows(DependencyInjectionException.class, () -> DependencyInjectionUtils.testAnnotation(RuntimeAnnotation.class));

assertDoesNotThrow(() -> DependencyInjectionUtils.testAnnotation(InjectableAnnotation.class));
Expand All @@ -39,6 +40,9 @@ static class NotAnAnnotation { }

@interface DefaultAnnotation { }

@Retention(RetentionPolicy.CLASS)
@interface ClassAnnotation { }

@Retention(RetentionPolicy.RUNTIME)
@interface RuntimeAnnotation { }

Expand Down

0 comments on commit bba15f7

Please sign in to comment.