@Test
    void verifyOperation() {
        val endpoint = new DuoSecurityAdminApiEndpoint(casProperties, this.applicationContext);
        try (val webServer = new MockWebServer(8443,
            new ByteArrayResource("{\"stat\": \"OK\" }".getBytes(StandardCharsets.UTF_8), "Output"), HttpStatus.OK)) {
            webServer.start();
            val result = endpoint.getUser("casuser", DuoSecurityMultifactorAuthenticationProperties.DEFAULT_IDENTIFIER);
            assertTrue(result.isEmpty());
        }

        try (val webServer = new MockWebServer(8443)) {
            webServer.responseBodySupplier(() -> new ClassPathResource("duoAdminApiResponse-user.json"));
            webServer.start();
            val result = endpoint.getUser("casuser", DuoSecurityMultifactorAuthenticationProperties.DEFAULT_IDENTIFIER);
            assertFalse(result.isEmpty());
            val user = result.get(DuoSecurityMultifactorAuthenticationProperties.DEFAULT_IDENTIFIER);
            assertNotNull(user.getUserId());
            assertNotNull(user.getFirstName());
            assertNotNull(user.getLastName());
            assertNotNull(user.getEmail());
            assertNotNull(user.getRealName());
            assertNotNull(user.getLastLogin());
            assertNotNull(user.getCreated());
            assertFalse(user.getDevices().isEmpty());
            assertTrue(user.getBypassCodes().isEmpty());
        }
    }
This is {@link DuoSecurityAdminApiEndpointTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-duo-core/src/test/java/org/apereo/cas/adaptors/duo/web/DuoSecurityAdminApiEndpointTests.java