SEC-2682: DelegatingSecurityContextRunnable/Callable delegate toString()
This commit is contained in:
@@ -126,6 +126,15 @@ public class DelegatingSecurityContextCallableTests {
|
||||
assertWrapped(callable.call());
|
||||
}
|
||||
|
||||
// --- toString
|
||||
|
||||
// SEC-2682
|
||||
@Test
|
||||
public void toStringDelegates() {
|
||||
callable = new DelegatingSecurityContextCallable<Object>(delegate, securityContext);
|
||||
assertThat(callable.toString()).isEqualTo(delegate.toString());
|
||||
}
|
||||
|
||||
private void assertWrapped(Object actualResult) throws Exception {
|
||||
assertThat(actualResult).isEqualTo(callableResult);
|
||||
verify(delegate).call();
|
||||
|
||||
@@ -127,6 +127,15 @@ public class DelegatingSecurityContextRunnableTests {
|
||||
assertWrapped();
|
||||
}
|
||||
|
||||
// --- toString
|
||||
|
||||
// SEC-2682
|
||||
@Test
|
||||
public void toStringDelegates() {
|
||||
runnable = new DelegatingSecurityContextRunnable(delegate, securityContext);
|
||||
assertThat(runnable.toString()).isEqualTo(delegate.toString());
|
||||
}
|
||||
|
||||
private void assertWrapped() {
|
||||
verify(delegate).run();
|
||||
assertThat(SecurityContextHolder.getContext()).isEqualTo(SecurityContextHolder.createEmptyContext());
|
||||
|
||||
Reference in New Issue
Block a user