@Test
    void verifyOkAccountFromExternalFileWithEncodedPassword() throws Throwable {
        val resource = new ClassPathResource("sample-users.json");
        val jsonHandler = new JsonResourceAuthenticationHandler(null, mock(ServicesManager.class),
            PrincipalFactoryUtils.newPrincipalFactory(), null, resource);

        val p = new PasswordEncoderProperties();
        p.setType(PasswordEncoderProperties.PasswordEncoderTypes.DEFAULT.name());
        p.setEncodingAlgorithm("MD5");
        p.setCharacterEncoding("UTF-8");
        jsonHandler.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(p, mock(ApplicationContext.class)));

        assertNotNull(jsonHandler.authenticate(CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casmd5", "Mellon"), mock(Service.class)));
    }
This is {@link JsonResourceAuthenticationHandlerTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-generic/src/test/java/org/apereo/cas/adaptors/generic/JsonResourceAuthenticationHandlerTests.java