Skip to content

Commit

Permalink
Switch to manual mocking instead of using Mockito annotation.
Browse files Browse the repository at this point in the history
Closes #2409
  • Loading branch information
mp911de committed Aug 8, 2024
1 parent 2625787 commit d294109
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
package org.springframework.data.rest.webmvc;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.rest.tests.AbstractControllerIntegrationTests;
import org.springframework.data.rest.webmvc.jpa.Book;
Expand All @@ -36,7 +35,6 @@
/**
* @author Oliver Gierke
*/
@ExtendWith(MockitoExtension.class)
@ContextConfiguration(classes = JpaRepositoryConfig.class)
@Transactional
class RepositoryPropertyReferenceControllerIntegrationTests extends AbstractControllerIntegrationTests {
Expand All @@ -45,7 +43,8 @@ class RepositoryPropertyReferenceControllerIntegrationTests extends AbstractCont
@Autowired TestDataPopulator populator;
@Autowired BookRepository books;

@Mock(answer = Answers.RETURNS_MOCKS) RepresentationModelAssemblers assembler;
RepresentationModelAssemblers assembler = mock(RepresentationModelAssemblers.class,
withSettings().defaultAnswer(Answers.RETURNS_MOCKS));
RootResourceInformation information;

@BeforeEach
Expand Down

0 comments on commit d294109

Please sign in to comment.