@Test
    void verifyInvalidAccounts() throws Throwable {
        val resource = new FileSystemResource(File.createTempFile("bad-account", ".json"));
        FileUtils.write(resource.getFile(), "invalid-data", StandardCharsets.UTF_8);
        val jsonHandler = new JsonResourceAuthenticationHandler(null, mock(ServicesManager.class),
            PrincipalFactoryUtils.newPrincipalFactory(), null, resource);
        assertThrows(PreventedException.class, () -> jsonHandler.authenticate(
            CoreAuthenticationTestUtils.getCredentialsWithDifferentUsernameAndPassword("casexpiring", "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