Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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;

Expand All @@ -28,12 +29,12 @@ class AccountControllerTest {
@Mock
private SecurityService securityService;

@InjectMocks
private AccountController accountController;

@BeforeEach
void setUp() {
lenient().when(securityService.clientId()).thenReturn(AUTH_CLIENT_ID);
accountController = new AccountController(accountService, securityService);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import lt.satsyuk.dto.AppResponse;
import lt.satsyuk.service.MessageService;
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.context.MessageSource;
Expand All @@ -26,13 +26,9 @@ class GlobalExceptionHandlerTest {
@Mock
private MessageService messageService;

@InjectMocks
private GlobalExceptionHandler handler;

@BeforeEach
void setUp() {
handler = new GlobalExceptionHandler(messageSource, messageService);
}

@Test
void handleIdempotencyKeyConflictReturns409() {
String key = "550e8400-e29b-41d4-a716-446655440000";
Expand Down