@Test
        void verifyPasswordChanged() throws Throwable {
            val data = "true";
            val request = new PasswordChangeRequest("casuser", "current-psw".toCharArray(), "123456".toCharArray(), "123456".toCharArray());
            try (val webServer = new MockWebServer(9309,
                new ByteArrayResource(data.getBytes(StandardCharsets.UTF_8), "REST Output"),
                MediaType.APPLICATION_JSON_VALUE)) {
                webServer.start();

                val props = new CasConfigurationProperties();
                val rest = props.getAuthn().getPm().getRest();
                rest.setEndpointUrlChange("http://localhost:9309");
                rest.setEndpointUrlSecurityQuestions("http://localhost:9309");
                rest.setEndpointUrlEmail("http://localhost:9309");
                val passwordService = getRestPasswordManagementService(props);

                val result = passwordService.change(request);
                assertTrue(result);
                webServer.stop();
            }

            try (val webServer = new MockWebServer(9090, HttpStatus.NO_CONTENT)) {
                webServer.start();
                val result = passwordChangeService.change(request);
                assertFalse(result);
                webServer.stop();
            }
        }
This is {@link RestPasswordManagementServiceTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-pm-rest/src/test/java/org/apereo/cas/pm/rest/RestPasswordManagementServiceTests.java