AwsSecurityContext implements SecurityContext { @Override public boolean isUserInRole(String role) { return false; } AwsSecurityContext(@Nullable String authenticationScheme, @Nullable Principal principal); @Override Principal getUserPrincipal(); @Override boolean isUserInRole(String role); @Override boolean isSecure(); @Override String getAuthenticationScheme();  }
@Test public void isUserInRole_Any_ShouldNeverBeInRole() { Principal principal = mock(Principal.class); assertFalse(new AwsSecurityContext(null, null).isUserInRole("user")); assertFalse(new AwsSecurityContext(null, null).isUserInRole(null)); assertFalse(new AwsSecurityContext("123", null).isUserInRole("user")); assertFalse(new AwsSecurityContext("123", principal).isUserInRole("user")); assertFalse(new AwsSecurityContext("123", principal).isUserInRole(null)); assertFalse(new AwsSecurityContext(null, principal).isUserInRole("user")); verifyZeroInteractions(principal); }