Skip to content

Commit 4b3c07e

Browse files
committed
Remove interaction verifications
1 parent b60e3f9 commit 4b3c07e

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/DefaultDbRefResolverUnitTests.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,6 @@ void emptyMapWithDocumentReferenceAnnotationShouldDeserializeToAnEmptyMap() {
162162

163163
Object target = resolver.resolveReference(property, source, lookupDelegate, entityReader);
164164

165-
verify(property, atLeastOnce()).isMap();
166-
verify(property, atLeastOnce()).isDocumentReference();
167-
verify(property, atLeastOnce()).getDocumentReference();
168-
verify(property, atLeastOnce()).isCollectionLike();
169-
verify(documentReference, atLeastOnce()).lookup();
170-
verify(documentReference, atLeastOnce()).sort();
171-
verify(documentReference, atLeastOnce()).lazy();
172-
verify(source, atLeastOnce()).getTargetSource();
173-
verifyNoMoreInteractions(documentReference, property, source); // Make sure we only call the properties we mocked.
174-
175165
assertThat(target)
176166
.isNotNull()
177167
.isInstanceOf(Map.class);
@@ -198,15 +188,6 @@ void lazyLoadedEmptyMapWithDocumentReferenceAnnotationShouldDeserializeToAnEmpty
198188

199189
Object target = resolver.resolveReference(property, source, lookupDelegate, entityReader);
200190

201-
verify(property, atLeastOnce()).isMap();
202-
verify(property, atLeastOnce()).isDocumentReference();
203-
verify(property, atLeastOnce()).getDocumentReference();
204-
verify(property, atLeastOnce()).isCollectionLike();
205-
verify(property, atLeastOnce()).getType();
206-
verify(documentReference, atLeastOnce()).lazy();
207-
verify(source, atLeastOnce()).getTargetSource();
208-
verifyNoMoreInteractions(documentReference, property, source); // Make sure we only call the properties we mocked.
209-
210191
assertThat(target)
211192
.isNotNull()
212193
.isInstanceOf(Map.class)

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/ReferenceLookupDelegateUnitTests.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class ReferenceLookupDelegateUnitTests {
4545

4646
@Mock MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext;
4747
@Mock SpELContext spELContext;
48-
@Mock EvaluationContext evaluationContext;
4948
@Mock MongoEntityReader entityReader;
5049

5150
private ReferenceLookupDelegate lookupDelegate;
@@ -115,20 +114,6 @@ void emptyMapWithDocumentReferenceAnnotationShouldDeserializeToAnEmptyMap() {
115114

116115
Object target = lookupDelegate.readReference(property, source, lookupFunction, entityReader);
117116

118-
// Since we mocked a placeholder that should never be called, make sure it is never called.
119-
verify(lookupFunction, never()).apply(any(), any());
120-
121-
// Verify that all the mocks we created are used.
122-
verify(property, atLeastOnce()).isMap();
123-
verify(property, atLeastOnce()).isDocumentReference();
124-
verify(property, atLeastOnce()).getDocumentReference();
125-
verify(property, atLeastOnce()).isCollectionLike();
126-
verify(documentReference, atLeastOnce()).lookup();
127-
verify(documentReference, atLeastOnce()).sort();
128-
129-
// Make sure we only call the properties we mocked.
130-
verifyNoMoreInteractions(documentReference, property, source);
131-
132117
assertThat(target)
133118
.isNotNull()
134119
.isInstanceOf(Map.class);

0 commit comments

Comments
 (0)