@Test
    void verifyServiceTicketRequestPrincipalMismatch() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        val tgt = new MockTicketGrantingTicket("randomuser");
        ticketRegistry.addTicket(tgt);
        val service = RegisteredServiceTestUtils.getService("service-ticket-request");
        val registeredService = RegisteredServiceTestUtils.getRegisteredService(service.getId());
        registeredService.setAccessStrategy(new DefaultRegisteredServiceAccessStrategy(true, true));
        servicesManager.save(registeredService);
        WebUtils.putTicketGrantingTicketInScopes(context, tgt);
        WebUtils.putServiceIntoFlowScope(context, service);
        WebUtils.putCredential(context, RegisteredServiceTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "Mellon"));
        assertNull(serviceTicketRequestWebflowEventResolver.resolveSingle(context));
    }
This is {@link ServiceTicketRequestWebflowEventResolverTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-webflow-mfa/src/test/java/org/apereo/cas/web/flow/resolver/impl/ServiceTicketRequestWebflowEventResolverTests.java