File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/test/java/org/cryptomator/integrations/common Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,18 @@ class C2 extends StaticFalse {
9797 Assertions .assertFalse (IntegrationsLoader .passesStaticAvailabilityCheck (C3 .class ));
9898 }
9999
100+ @ Test
101+ @ DisplayName ("throwing @CheckAvailability methods are treated as false" )
102+ public void testPassesAvailabilityCheckThrowing () {
103+
104+ @ CheckAvailability class C1 {
105+ @ CheckAvailability public static boolean test () { throw new RuntimeException ("FAIL" ); }
106+ }
107+
108+ Assertions .assertFalse (IntegrationsLoader .passesStaticAvailabilityCheck (C1 .class ));
109+ Assertions .assertFalse (IntegrationsLoader .passesStaticAvailabilityCheck (InitExceptionTestClass .class ));
110+ Assertions .assertFalse (IntegrationsLoader .passesStaticAvailabilityCheck (InitExceptionTestClass .class )); //NoClassDefFoundError due to repated call
111+ }
100112
101113 }
102114
@@ -190,6 +202,26 @@ class C2 extends InstanceFalse {
190202 Assertions .assertFalse (IntegrationsLoader .passesInstanceAvailabilityCheck (new C3 ()));
191203 }
192204
205+
206+ @ Test
207+ @ DisplayName ("throwing @CheckAvailability methods are treated as false" )
208+ public void testPassesAvailabilityCheckThrowing () {
209+
210+ @ CheckAvailability
211+ class C1 {
212+ @ CheckAvailability public boolean test1 () { throw new RuntimeException ("FAIL" ); }
213+ }
214+
215+ @ CheckAvailability
216+ class C2 {
217+ @ CheckAvailability public boolean test1 () { return true ; }
218+ @ CheckAvailability public boolean test2 () { throw new RuntimeException ("FAIL" ); }
219+ }
220+
221+ Assertions .assertFalse (IntegrationsLoader .passesInstanceAvailabilityCheck (new C1 ()));
222+ Assertions .assertFalse (IntegrationsLoader .passesInstanceAvailabilityCheck (new C2 ()));
223+ }
224+
193225 }
194226
195227}
You can’t perform that action at this time.
0 commit comments