Fix tests
This commit is contained in:
@@ -13,8 +13,12 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Setter
|
||||
public class BotUser {
|
||||
|
||||
public BotUser(long l, String testuser) {
|
||||
}
|
||||
|
||||
public enum UserType {
|
||||
USER, ADMIN }
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package ru.cathub.telegabot.service.impl;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
@@ -35,8 +36,8 @@ class BookCreationServiceImplTest {
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
testUser = new BotUser();
|
||||
testUser.setId(1L); // Явная установка ID
|
||||
testUser.setUsername("testuser");
|
||||
testUser.setId(1L);
|
||||
testUser.setChatId(1L); // Явная установка ID
|
||||
testCache = new BookCreationCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import ru.cathub.telegabot.utils.BookFormatUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import ru.cathub.telegabot.model.BookCreationCache;
|
||||
import ru.cathub.telegabot.model.BotUser;
|
||||
import ru.cathub.telegabot.repository.UserRepository;
|
||||
import ru.cathub.telegabot.service.*;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
import static ru.cathub.telegabot.utils.Constants.*;
|
||||
|
||||
Reference in New Issue
Block a user