@Test public void testGetCurrentSubjectNoSubject() { IllegalStateException e = assertThrows(IllegalStateException.class, () -> { JaasUtils.getCurrentSubject(); }); assertThat(e.getMessage()).isEqualTo("No subject found in current context."); }
public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; } }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }  }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }  static Subject getCurrentSubject(); static P getPrincipal(final Class<P> principalClass); static T getPrivateCredential(final Class<T> credentialClass); static boolean hasPrincipal(final Class<? extends Principal> principalClass); }
JaasUtils { public static Subject getCurrentSubject() { final Subject subject = Subject.getSubject(AccessController.getContext()); if (subject == null) throw new IllegalStateException("No subject found in current context."); return subject; }  static Subject getCurrentSubject(); static P getPrincipal(final Class<P> principalClass); static T getPrivateCredential(final Class<T> credentialClass); static boolean hasPrincipal(final Class<? extends Principal> principalClass);  }