|
54 | 54 | * @author Oliver Gierke
|
55 | 55 | */
|
56 | 56 | @RunWith(MockitoJUnitRunner.class)
|
57 |
| -public class AbstracMongoQueryUnitTests { |
| 57 | +public class AbstractMongoQueryUnitTests { |
58 | 58 |
|
59 | 59 | @Mock RepositoryMetadata metadataMock;
|
60 | 60 | @Mock MongoOperations mongoOperationsMock;
|
@@ -88,7 +88,8 @@ public void testDeleteExecutionCallsRemoveCorreclty() {
|
88 | 88 |
|
89 | 89 | createQueryForMethod("deletePersonByLastname", String.class).setDeleteQuery(true).execute(new Object[] { "booh" });
|
90 | 90 |
|
91 |
| - verify(this.mongoOperationsMock, times(1)).remove(Matchers.any(Query.class), Matchers.eq("persons")); |
| 91 | + verify(this.mongoOperationsMock, times(1)).remove(Matchers.any(Query.class), Matchers.eq(Person.class), |
| 92 | + Matchers.eq("persons")); |
92 | 93 | verify(this.mongoOperationsMock, times(0)).find(Matchers.any(Query.class), Matchers.any(Class.class),
|
93 | 94 | Matchers.anyString());
|
94 | 95 | }
|
@@ -122,19 +123,21 @@ public void testDeleteExecutionReturnsZeroWhenWriteResultIsNull() {
|
122 | 123 |
|
123 | 124 | /**
|
124 | 125 | * @see DATAMONGO-566
|
| 126 | + * @see DATAMONGO-978 |
125 | 127 | */
|
126 | 128 | @Test
|
127 | 129 | public void testDeleteExecutionReturnsNrDocumentsDeletedFromWriteResult() {
|
128 | 130 |
|
129 | 131 | when(writeResultMock.getN()).thenReturn(100);
|
130 |
| - when(this.mongoOperationsMock.remove(Matchers.any(Query.class), Matchers.eq("persons"))) |
| 132 | + when(this.mongoOperationsMock.remove(Matchers.any(Query.class), Matchers.eq(Person.class), Matchers.eq("persons"))) |
131 | 133 | .thenReturn(writeResultMock);
|
132 | 134 |
|
133 | 135 | MongoQueryFake query = createQueryForMethod("deletePersonByLastname", String.class);
|
134 | 136 | query.setDeleteQuery(true);
|
135 | 137 |
|
136 | 138 | assertThat(query.execute(new Object[] { "fake" }), is((Object) 100L));
|
137 |
| - verify(this.mongoOperationsMock, times(1)).remove(Matchers.any(Query.class), Matchers.eq("persons")); |
| 139 | + verify(this.mongoOperationsMock, times(1)).remove(Matchers.any(Query.class), Matchers.eq(Person.class), |
| 140 | + Matchers.eq("persons")); |
138 | 141 | }
|
139 | 142 |
|
140 | 143 | private MongoQueryFake createQueryForMethod(String methodName, Class<?>... paramTypes) {
|
|
0 commit comments