Skip to content

Commit

Permalink
ugly fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejFrnka committed Apr 23, 2024
1 parent 398983d commit 858e92a
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,44 @@
import com.sportsmatch.dtos.UserDTO;
import com.sportsmatch.dtos.UserInfoDTO;
import com.sportsmatch.mappers.SportMapper;
import com.sportsmatch.mappers.UserMapper;
import com.sportsmatch.models.*;
import com.sportsmatch.repositories.SportRepository;
import com.sportsmatch.repositories.UserRepository;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
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.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.crypto.password.PasswordEncoder;

@ExtendWith(MockitoExtension.class)
class UserServiceImpTest extends BaseTest {

@Mock private UserRepository userRepository;
@Mock private SportRepository sportRepository;
@Mock private SportMapper sportMapper;
@Mock private SecurityContext securityContext;
@Mock private RankService rankService;
@InjectMocks private UserServiceImp userServiceImp;
@Mock private PasswordEncoder passwordEncoder;
private UserServiceImp userServiceImp;

@BeforeEach
void initialize(){
userServiceImp = new UserServiceImp(userRepository, sportMapper, sportRepository,
new UserMapper(passwordEncoder, sportMapper),rankService);
}

@Test
void updateUserInfo() {
Expand Down

0 comments on commit 858e92a

Please sign in to comment.