Skip to content

Commit 407affb

Browse files
committed
DATAMONGO-1141 - Polishing.
Aligned assertion messages for consistency. Fixed imports in UpdateMapperUnitTests. Original pull request: #405.
1 parent c6a4e71 commit 407affb

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Update.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public Update currentTimestamp(String key) {
316316
*/
317317
public Update multiply(String key, Number multiplier) {
318318

319-
Assert.notNull(multiplier, "Multiplier must not be 'null'.");
319+
Assert.notNull(multiplier, "Multiplier must not be null.");
320320
addMultiFieldOperation("$mul", key, multiplier.doubleValue());
321321
return this;
322322
}
@@ -333,7 +333,7 @@ public Update multiply(String key, Number multiplier) {
333333
*/
334334
public Update max(String key, Object value) {
335335

336-
Assert.notNull(value, "Value for max operation must not be 'null'.");
336+
Assert.notNull(value, "Value for max operation must not be null.");
337337
addMultiFieldOperation("$max", key, value);
338338
return this;
339339
}
@@ -350,7 +350,7 @@ public Update max(String key, Object value) {
350350
*/
351351
public Update min(String key, Object value) {
352352

353-
Assert.notNull(value, "Value for min operation must not be 'null'.");
353+
Assert.notNull(value, "Value for min operation must not be null.");
354354
addMultiFieldOperation("$min", key, value);
355355
return this;
356356
}
@@ -782,7 +782,7 @@ public PushOperatorBuilder slice(int count) {
782782
*/
783783
public PushOperatorBuilder sort(Direction direction) {
784784

785-
Assert.notNull(direction, "Direction must not be 'null'.");
785+
Assert.notNull(direction, "Direction must not be null.");
786786
this.modifiers.addModifier(new SortModifier(direction));
787787
return this;
788788
}
@@ -797,7 +797,7 @@ public PushOperatorBuilder sort(Direction direction) {
797797
*/
798798
public PushOperatorBuilder sort(Sort sort) {
799799

800-
Assert.notNull(sort, "Sort must not be 'null'.");
800+
Assert.notNull(sort, "Sort must not be null.");
801801
this.modifiers.addModifier(new SortModifier(sort));
802802
return this;
803803
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
*/
1616
package org.springframework.data.mongodb.core.convert;
1717

18-
import static org.hamcrest.CoreMatchers.*;
19-
import static org.hamcrest.Matchers.equalTo;
20-
import static org.hamcrest.collection.IsMapContaining.*;
18+
import static org.hamcrest.Matchers.*;
2119
import static org.junit.Assert.*;
2220
import static org.mockito.Mockito.*;
2321
import static org.springframework.data.mongodb.core.DBObjectTestUtils.*;
@@ -85,6 +83,7 @@ public class UpdateMapperUnitTests {
8583
private Converter<NestedEntity, DBObject> writingConverterSpy;
8684

8785
@Before
86+
@SuppressWarnings("unchecked")
8887
public void setUp() {
8988

9089
this.writingConverterSpy = Mockito.spy(new NestedEntityWriteConverter());

0 commit comments

Comments
 (0)