@Test
    void verifyNoProfile() throws Throwable {
        val service = getRegisteredService(REDIRECT_URI, UUID.randomUUID().toString(), CLIENT_SECRET);
        servicesManager.save(service);

        val request = new MockHttpServletRequest();
        request.addParameter(OAuth20Constants.REDIRECT_URI, REDIRECT_URI);
        request.addParameter(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.PASSWORD.getType());
        request.addParameter(OAuth20Constants.CLIENT_ID, service.getClientId());

        val principal = RegisteredServiceTestUtils.getPrincipal();
        val code = addCode(principal, service);
        request.addParameter(OAuth20Constants.CODE, code.getId());

        val response = new MockHttpServletResponse();
        val extractor = new AccessTokenPasswordGrantRequestExtractor(new DirectObjectProvider<>(oauth20ConfigurationContext));
        assertTrue(extractor.requestMustBeAuthenticated());
        assertNull(extractor.getResponseType());

        val context = new JEEContext(request, response);
        assertThrows(UnauthorizedServiceException.class, () -> extractor.extract(context));
    }
This is {@link AccessTokenPasswordGrantRequestExtractorTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/response/accesstoken/ext/AccessTokenPasswordGrantRequestExtractorTests.java