Skip to content

Commit ce14e44

Browse files
committed
Switch to manual mocking instead of using Mockito annotation.
Closes #2409
1 parent aac30f1 commit ce14e44

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/RepositoryPropertyReferenceControllerIntegrationTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
package org.springframework.data.rest.webmvc;
1717

1818
import static org.assertj.core.api.Assertions.*;
19+
import static org.mockito.Mockito.*;
1920

2021
import org.junit.jupiter.api.BeforeEach;
2122
import org.junit.jupiter.api.Test;
22-
import org.junit.jupiter.api.extension.ExtendWith;
2323
import org.mockito.Answers;
24-
import org.mockito.Mock;
25-
import org.mockito.junit.jupiter.MockitoExtension;
24+
2625
import org.springframework.beans.factory.annotation.Autowired;
2726
import org.springframework.data.rest.tests.AbstractControllerIntegrationTests;
2827
import org.springframework.data.rest.webmvc.jpa.Book;
@@ -36,7 +35,6 @@
3635
/**
3736
* @author Oliver Gierke
3837
*/
39-
@ExtendWith(MockitoExtension.class)
4038
@ContextConfiguration(classes = JpaRepositoryConfig.class)
4139
@Transactional
4240
class RepositoryPropertyReferenceControllerIntegrationTests extends AbstractControllerIntegrationTests {
@@ -45,7 +43,8 @@ class RepositoryPropertyReferenceControllerIntegrationTests extends AbstractCont
4543
@Autowired TestDataPopulator populator;
4644
@Autowired BookRepository books;
4745

48-
@Mock(answer = Answers.RETURNS_MOCKS) RepresentationModelAssemblers assembler;
46+
RepresentationModelAssemblers assembler = mock(RepresentationModelAssemblers.class,
47+
withSettings().defaultAnswer(Answers.RETURNS_MOCKS));
4948
RootResourceInformation information;
5049

5150
@BeforeEach

0 commit comments

Comments
 (0)