@Test
        void verifyTenantCaptured() throws Throwable {
            val context = MockRequestContext.create(applicationContext);
            context.setContextPath("/tenants/shire/login");
            val id = "https://app.%s.org#helloworld".formatted(UUID.randomUUID().toString());
            WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService(id));
            context.setParameter(CasProtocolConstants.PARAMETER_SERVICE, id);
            val registeredService = RegisteredServiceTestUtils.getRegisteredService(id, Map.of());
            servicesManager.save(registeredService);

            val credential = RegisteredServiceTestUtils.getCredentialsWithSameUsernameAndPassword(id);
            WebUtils.putCredential(context, credential);
            val event = initialAuthenticationAttemptWebflowEventResolver.resolveSingle(context);
            assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, event.getId());
            assertEquals("shire", credential.getCredentialMetadata().getTenant());
        }
This is {@link DefaultCasDelegatingWebflowEventResolverTests}.

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