@Test
    void verifyUndefinedOrPublicSubjectType() throws Throwable {
        val applicationContext = new StaticApplicationContext();
        applicationContext.refresh();

        val provider = new PairwiseOidcRegisteredServiceUsernameAttributeProvider();

        val registeredService = new OidcRegisteredService();
        registeredService.setName("verifyUndefinedOrPublicSubjectType");
        registeredService.setServiceId("testId");
        registeredService.setClientId("clientid");
        registeredService.setClientSecret("something");

        registeredService.setSubjectType(StringUtils.EMPTY);

        val usernameContext = RegisteredServiceUsernameProviderContext.builder()
            .registeredService(registeredService)
            .service(RegisteredServiceTestUtils.getService())
            .principal(RegisteredServiceTestUtils.getPrincipal("casuser"))
            .applicationContext(applicationContext)
            .build();
        var uid = provider.resolveUsername(usernameContext);
        assertEquals("casuser", uid);

        registeredService.setSubjectType(null);
        uid = provider.resolveUsername(usernameContext);
        assertEquals("casuser", uid);

        registeredService.setSubjectType(OidcSubjectTypes.PUBLIC.getType());
        uid = provider.resolveUsername(usernameContext);
        assertEquals("casuser", uid);
    }
This is {@link PairwiseOidcRegisteredServiceUsernameAttributeProviderTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oidc-services/src/test/java/org/apereo/cas/services/PairwiseOidcRegisteredServiceUsernameAttributeProviderTests.java