AwsSecurityContext implements SecurityContext { @Override public Principal getUserPrincipal() { return principal; } AwsSecurityContext(@Nullable String authenticationScheme, @Nullable Principal principal); @Override Principal getUserPrincipal(); @Override boolean isUserInRole(String role); @Override boolean isSecure(); @Override String getAuthenticationScheme();  }
@Test public void getUserPrincipal_PrincipalGiven_ShouldReturnPrincipal() { Principal principal = mock(Principal.class); assertEquals(principal, new AwsSecurityContext(null, principal).getUserPrincipal()); }