We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 496d326 commit 0ad4bd9Copy full SHA for 0ad4bd9
src/test/com/mongodb/JavaClientTest.java
@@ -685,11 +685,18 @@ public void testFindAndModify(){
685
assertNull( c.findOne(new BasicDBObject( "_id" , 1 ) ));
686
687
// test exception throwing
688
+ c.insert( new BasicDBObject( "a" , 1 ) );
689
try {
690
dbObj = c.findAndModify( null, null );
- assertTrue(false, "Exception not throw when no update nor remove");
691
+ assertTrue(false, "Exception not thrown when no update nor remove");
692
} catch (MongoException e) {
693
}
694
+
695
+ try {
696
+ dbObj = c.findAndModify( new BasicDBObject("a", "noexist"), null );
697
+ } catch (MongoException e) {
698
+ assertTrue(false, "Exception thrown when matching record");
699
+ }
700
701
702
@Test
0 commit comments