// Mock up message context
MessageImpl msg = new MessageImpl();
WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
TokenDelegationHandler delegationHandler = new UsernameTokenDelegationHandler();
issueOperation.setDelegationHandlers(Collections.singletonList(delegationHandler));
// Issue a token - this will fail as the UsernameToken validation fails
try {
issueOperation.issue(request, webServiceContext);