@Test
    void verifyProcessorWorks() {
        val credential = new UsernamePasswordCredential();
        credential.setUsername("casuser");
        credential.assignPassword("Mellon");
        credential.getCredentialMetadata().addTrait(new SurrogateCredentialTrait("cassurrogate"));
        val transaction = CoreAuthenticationTestUtils.getAuthenticationTransactionFactory().newTransaction(RegisteredServiceTestUtils.getService("https://localhost"), credential);
        val builder = mock(AuthenticationBuilder.class);
        when(builder.build()).thenReturn(CoreAuthenticationTestUtils.getAuthentication("casuser"));
        assertDoesNotThrow(() -> surrogateAuthenticationPostProcessor.process(builder, transaction));
    }
This is {@link SurrogateAuthenticationPostProcessorTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-surrogate-authentication/src/test/java/org/apereo/cas/authentication/SurrogateAuthenticationPostProcessorTests.java