@Override
    public NacosUser authenticate(String username, String rawPassword) throws AccessException {
        if (StringUtils.isBlank(username) || StringUtils.isBlank(rawPassword)) {
            throw new AccessException("user not found!");
        }
        NacosUserDetails nacosUserDetails = (NacosUserDetails) userDetailsService.loadUserByUsername(username);
        if (nacosUserDetails == null || !PasswordEncoderUtil.matches(rawPassword, nacosUserDetails.getPassword())) {
            throw new AccessException("user not found!");
        }
        return new NacosUser(nacosUserDetails.getUsername(), jwtTokenManager.createToken(username));
    }
@Test
    void testAuthenticate9() throws AccessException {
        NacosUserDetails nacosUserDetails = new NacosUserDetails(user);
        when(userDetailsService.loadUserByUsername(anyString())).thenReturn(nacosUserDetails);
        
        when(jwtTokenManager.createToken(anyString())).thenReturn("token");
        MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest();
        mockHttpServletRequest.addHeader(AuthConstants.AUTHORIZATION_HEADER, "token");
        mockHttpServletRequest.addParameter(AuthConstants.PARAM_USERNAME, "nacos");
        mockHttpServletRequest.addParameter(AuthConstants.PARAM_PASSWORD, "test");
        NacosUser authenticate = abstractAuthenticationManager.authenticate(mockHttpServletRequest);
        
        assertEquals("token", authenticate.getToken());
        assertEquals(user.getUsername(), authenticate.getUserName());
    }