Skip to content

Commit ecd8dae

Browse files
committed
DATAMONGO-1141 - Polishing.
Aligned assertion messages for consistency. Fixed imports in UpdateMapperUnitTests. Original pull request: spring-projects#405.
1 parent 4b59736 commit ecd8dae

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public Update currentTimestamp(String key) {
314314
*/
315315
public Update multiply(String key, Number multiplier) {
316316

317-
Assert.notNull(multiplier, "Multiplier must not be 'null'.");
317+
Assert.notNull(multiplier, "Multiplier must not be null.");
318318
addMultiFieldOperation("$mul", key, multiplier.doubleValue());
319319
return this;
320320
}
@@ -331,7 +331,7 @@ public Update multiply(String key, Number multiplier) {
331331
*/
332332
public Update max(String key, Object value) {
333333

334-
Assert.notNull(value, "Value for max operation must not be 'null'.");
334+
Assert.notNull(value, "Value for max operation must not be null.");
335335
addMultiFieldOperation("$max", key, value);
336336
return this;
337337
}
@@ -348,7 +348,7 @@ public Update max(String key, Object value) {
348348
*/
349349
public Update min(String key, Object value) {
350350

351-
Assert.notNull(value, "Value for min operation must not be 'null'.");
351+
Assert.notNull(value, "Value for min operation must not be null.");
352352
addMultiFieldOperation("$min", key, value);
353353
return this;
354354
}
@@ -780,7 +780,7 @@ public PushOperatorBuilder slice(int count) {
780780
*/
781781
public PushOperatorBuilder sort(Direction direction) {
782782

783-
Assert.notNull(direction, "Direction must not be 'null'.");
783+
Assert.notNull(direction, "Direction must not be null.");
784784
this.modifiers.addModifier(new SortModifier(direction));
785785
return this;
786786
}
@@ -795,7 +795,7 @@ public PushOperatorBuilder sort(Direction direction) {
795795
*/
796796
public PushOperatorBuilder sort(Sort sort) {
797797

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

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.data.mongodb.core.convert;
1717

18-
import static org.hamcrest.CoreMatchers.*;
18+
import static org.hamcrest.Matchers.*;
1919
import static org.junit.Assert.*;
2020
import static org.mockito.Mockito.*;
2121
import static org.springframework.data.mongodb.core.DocumentTestUtils.*;
@@ -76,6 +76,7 @@ public class UpdateMapperUnitTests {
7676
private Converter<NestedEntity, Document> writingConverterSpy;
7777

7878
@Before
79+
@SuppressWarnings("unchecked")
7980
public void setUp() {
8081

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

0 commit comments

Comments
 (0)