DATAMONGO-1141 - Polishing.
Aligned assertion messages for consistency. Fixed imports in UpdateMapperUnitTests. Original pull request: #405.
This commit is contained in:
@@ -316,7 +316,7 @@ public class Update {
|
|||||||
*/
|
*/
|
||||||
public Update multiply(String key, Number multiplier) {
|
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());
|
addMultiFieldOperation("$mul", key, multiplier.doubleValue());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@ public class Update {
|
|||||||
*/
|
*/
|
||||||
public Update max(String key, Object value) {
|
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);
|
addMultiFieldOperation("$max", key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -350,7 +350,7 @@ public class Update {
|
|||||||
*/
|
*/
|
||||||
public Update min(String key, Object value) {
|
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);
|
addMultiFieldOperation("$min", key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -782,7 +782,7 @@ public class Update {
|
|||||||
*/
|
*/
|
||||||
public PushOperatorBuilder sort(Direction direction) {
|
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));
|
this.modifiers.addModifier(new SortModifier(direction));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -797,7 +797,7 @@ public class Update {
|
|||||||
*/
|
*/
|
||||||
public PushOperatorBuilder sort(Sort sort) {
|
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));
|
this.modifiers.addModifier(new SortModifier(sort));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.data.mongodb.core.convert;
|
package org.springframework.data.mongodb.core.convert;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
|
||||||
import static org.hamcrest.collection.IsMapContaining.*;
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
import static org.mockito.Mockito.*;
|
import static org.mockito.Mockito.*;
|
||||||
import static org.springframework.data.mongodb.core.DBObjectTestUtils.*;
|
import static org.springframework.data.mongodb.core.DBObjectTestUtils.*;
|
||||||
@@ -85,6 +83,7 @@ public class UpdateMapperUnitTests {
|
|||||||
private Converter<NestedEntity, DBObject> writingConverterSpy;
|
private Converter<NestedEntity, DBObject> writingConverterSpy;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
|
||||||
this.writingConverterSpy = Mockito.spy(new NestedEntityWriteConverter());
|
this.writingConverterSpy = Mockito.spy(new NestedEntityWriteConverter());
|
||||||
|
|||||||
Reference in New Issue
Block a user