fix
This commit is contained in:
parent
22ccd24f77
commit
33e2bddf92
@ -8,6 +8,7 @@ import com.lk.paopao.security.JwtUtils;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
@ -37,17 +38,14 @@ class AuthServiceTest {
|
||||
@Mock
|
||||
private JwtUtils mockJwtUtils;
|
||||
|
||||
@InjectMocks
|
||||
private AuthService authServiceUnderTest;
|
||||
|
||||
String TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEwMDA2NiwidXNlcm5hbWUiOiJ4eXoiLCJpc3MiOiI4ZGNlMGM3NjcyMWFkODFiYzQxMjRhMDhjMTBkNDk3MSIsImV4cCI6MTcxNzYzODgxMn0.TdAMHh4n7SQVipXK-_zRsk5jhCVpoZI4jnlUIR7iO-I";
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
authServiceUnderTest = new AuthService();
|
||||
|
||||
ReflectionTestUtils.setField(authServiceUnderTest, "DEFAULT_HEAD_ICON", "avatar");
|
||||
authServiceUnderTest.userRepository = mockUserRepository;
|
||||
authServiceUnderTest.authenticationManager = mockAuthenticationManager;
|
||||
authServiceUnderTest.encoder = mockEncoder;
|
||||
authServiceUnderTest.jwtUtils = mockJwtUtils;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user