File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -849,15 +849,20 @@ public void testFindAndModify(){
849849 // test exception throwing
850850 c .insert ( new BasicDBObject ( "a" , 1 ) );
851851 try {
852- dbObj = c .findAndModify ( null , null );
853- assertTrue ( false , "Exception not thrown when no update nor remove" );
852+ c .findAndModify ( null , null );
853+ fail ( "Exception not thrown when no update nor remove" );
854854 } catch (MongoException e ) {
855855 }
856856
857857 try {
858858 dbObj = c .findAndModify ( new BasicDBObject ("a" , "noexist" ), null );
859+ if (!serverIsAtLeastVersion (2.1 )) {
860+ assertNull (dbObj );
861+ }
859862 } catch (MongoException e ) {
860- assertTrue (false , "Exception thrown when matching record" );
863+ if (!serverIsAtLeastVersion (2.1 )) {
864+ fail ("Exception thrown when matching record" );
865+ }
861866 }
862867 }
863868
You can’t perform that action at this time.
0 commit comments