DATACOUCH-36 - Don't allow NULL values to be stored.
It is illegal to store a NULL value as a document. An attempt to do so will throw an IllegalArgumentException. -=david=-
This commit is contained in:
@@ -179,6 +179,18 @@ public class CouchbaseTemplateTests {
|
||||
assertNotNull(beer.getActive());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldNotSaveNull() {
|
||||
final Map<String, String> things = new HashMap<String, String>();
|
||||
things.put("key", null);
|
||||
try {
|
||||
template.save(things);
|
||||
fail("We should not be able to store a NULL!");
|
||||
} catch(final IllegalArgumentException e) {
|
||||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A sample document with just an id and property.
|
||||
|
||||
Reference in New Issue
Block a user