-
-
Save matzew/ed817310bc8ea523e536 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String password = "Basic ZWM4MjYwYjUtNWRiMi00NDNhLTkwZGItNjRlNDlkMTQ3YzIxOjRiMDlhOGI3LTg4ZGEtNGJjNi05MjJhLWM2NWZkNDAwNDVmMw=="; | |
final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); | |
Mockito.when(request.getHeader("Authorization")).thenReturn(password); | |
final String[] credentials = HttpBasicHelper.extractUsernameAndPasswordFromBasicHeader(request); | |
System.out.println( credentials[0]); | |
System.out.println( credentials[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment