DATAMONGO-1141 - Polishing.

Aligned assertion messages for consistency. Fixed imports in  UpdateMapperUnitTests.

Original pull request: #405.
This commit is contained in:
Oliver Gierke
2016-12-02 18:12:23 +01:00
parent c6a4e7166c
commit 407affb458
2 changed files with 7 additions and 8 deletions

View File

@@ -316,7 +316,7 @@ public class Update {
*/
public Update multiply(String key, Number multiplier) {
Assert.notNull(multiplier, "Multiplier must not be 'null'.");
Assert.notNull(multiplier, "Multiplier must not be null.");
addMultiFieldOperation("$mul", key, multiplier.doubleValue());
return this;
}
@@ -333,7 +333,7 @@ public class Update {
*/
public Update max(String key, Object value) {
Assert.notNull(value, "Value for max operation must not be 'null'.");
Assert.notNull(value, "Value for max operation must not be null.");
addMultiFieldOperation("$max", key, value);
return this;
}
@@ -350,7 +350,7 @@ public class Update {
*/
public Update min(String key, Object value) {
Assert.notNull(value, "Value for min operation must not be 'null'.");
Assert.notNull(value, "Value for min operation must not be null.");
addMultiFieldOperation("$min", key, value);
return this;
}
@@ -782,7 +782,7 @@ public class Update {
*/
public PushOperatorBuilder sort(Direction direction) {
Assert.notNull(direction, "Direction must not be 'null'.");
Assert.notNull(direction, "Direction must not be null.");
this.modifiers.addModifier(new SortModifier(direction));
return this;
}
@@ -797,7 +797,7 @@ public class Update {
*/
public PushOperatorBuilder sort(Sort sort) {
Assert.notNull(sort, "Sort must not be 'null'.");
Assert.notNull(sort, "Sort must not be null.");
this.modifiers.addModifier(new SortModifier(sort));
return this;
}

View File

@@ -15,9 +15,7 @@
*/
package org.springframework.data.mongodb.core.convert;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.collection.IsMapContaining.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import static org.springframework.data.mongodb.core.DBObjectTestUtils.*;
@@ -85,6 +83,7 @@ public class UpdateMapperUnitTests {
private Converter<NestedEntity, DBObject> writingConverterSpy;
@Before
@SuppressWarnings("unchecked")
public void setUp() {
this.writingConverterSpy = Mockito.spy(new NestedEntityWriteConverter());