Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
max402 committed Sep 19, 2023
1 parent d84a8c5 commit 32420dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ public class AuthenticateControllerTest extends BaseDatasafeEndpointTest {

@BeforeEach
public void setup() {
openMocks = MockitoAnnotations.openMocks(this);
when(dataSafeService.inboxService()).thenReturn(inboxService);
}

@Test
void testAuthenticateSuccess() {
MockitoAnnotations.initMocks(this);

UserDTO userDTO = new UserDTO();
userDTO.setUserName("username");
userDTO.setPassword("password");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.MockitoAnnotations;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
Expand Down Expand Up @@ -51,6 +52,7 @@ class UserControllerTest extends BaseTokenDatasafeEndpointTest {

@BeforeEach
public void setup() {
openMocks = MockitoAnnotations.openMocks(this);
when(dataSafeService.userProfile()).thenReturn(userProfile);
gson = new Gson();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public abstract class BaseMockitoTest {

AutoCloseable openMocks;
public AutoCloseable openMocks;

@BeforeEach
public void setup() {
Expand Down

0 comments on commit 32420dc

Please sign in to comment.