Add toString() method so more informative when context propagation takes place, such as via ContextPropagatingRemoteInvocation.
This commit is contained in:
@@ -55,11 +55,14 @@ public class SecureContextImplTests extends TestCase {
|
||||
context.setAuthentication(auth);
|
||||
context.validate();
|
||||
assertEquals(auth, context.getAuthentication());
|
||||
assertTrue(context.toString().lastIndexOf("marissa") != -1);
|
||||
}
|
||||
|
||||
public void testSecureContextDetectsMissingAuthenticationObject() {
|
||||
SecureContext context = new SecureContextImpl();
|
||||
|
||||
assertTrue(context.toString().lastIndexOf("Null authentication") != -1);
|
||||
|
||||
try {
|
||||
context.validate();
|
||||
fail("Should have thrown ContextInvalidException");
|
||||
|
||||
Reference in New Issue
Block a user