@Test void getCurrentRealm() { SecurityContextHolder.getContext().setAuthentication( new UsernamePasswordAuthenticationToken(LOGIN, getTokenDetails(), new ArrayList<>())); assertNotNull(SecurityContextHolder.getContext().getAuthentication()); assertEquals(REALM, securityHelper.getCurrentRealm()); }
public String getCurrentRealm() { TokenDetails tokenDetails = null; Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { tokenDetails = getTokenDetails(authentication); } if (tokenDetails != null) { return tokenDetails.getRealm(); } return null; }
SecurityHelper { public String getCurrentRealm() { TokenDetails tokenDetails = null; Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { tokenDetails = getTokenDetails(authentication); } if (tokenDetails != null) { return tokenDetails.getRealm(); } return null; } }
SecurityHelper { public String getCurrentRealm() { TokenDetails tokenDetails = null; Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { tokenDetails = getTokenDetails(authentication); } if (tokenDetails != null) { return tokenDetails.getRealm(); } return null; }  }
SecurityHelper { public String getCurrentRealm() { TokenDetails tokenDetails = null; Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { tokenDetails = getTokenDetails(authentication); } if (tokenDetails != null) { return tokenDetails.getRealm(); } return null; }  String getCurrentRealm(); String getCurrentLogin(); }
SecurityHelper { public String getCurrentRealm() { TokenDetails tokenDetails = null; Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { tokenDetails = getTokenDetails(authentication); } if (tokenDetails != null) { return tokenDetails.getRealm(); } return null; }  String getCurrentRealm(); String getCurrentLogin();  }