@Test
    void verifyBadResponse() {
        try (val webServer = new MockWebServer("abcde123456")) {
            webServer.start();
            val props = new RestEndpointProperties();
            props.setUrl("http://localhost:%s".formatted(webServer.getPort()));
            val factory = PrincipalFactoryUtils.newRestfulPrincipalFactory(props);
            assertThrows(IllegalArgumentException.class,
                () -> factory.createPrincipal("casuser", CollectionUtils.wrap("name", List.of("CAS"))));
        }
    }
This is {@link RestfulPrincipalFactoryTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-authentication-api/src/test/java/org/apereo/cas/authentication/RestfulPrincipalFactoryTests.java