AnonSecurityContext implements SecurityContext { @Override public boolean isSecure() { return secure; } AnonSecurityContext();  AnonSecurityContext(boolean secure); @Override Principal getUserPrincipal(); @Override boolean isUserInRole(String role); @Override boolean isSecure(); @Override String getAuthenticationScheme();  }
@Test public void isSecure_SecureConstructorArgGiven_ShouldBeSecure() { assertTrue(new AnonSecurityContext(true).isSecure()); }
@Test public void isSecure_InsecureConstructorArgGiven_ShouldBeInSecure() { assertFalse(new AnonSecurityContext(false).isSecure()); }
@Test public void isSecure_NoSecurityConstructorArgGiven_ShouldBeSecure() { assertTrue(new AnonSecurityContext().isSecure()); }