@@ -84,8 +84,7 @@ public CrudTest(final String filename, final String description, final String da
8484 @ Before
8585 public void setUp () {
8686 assumeFalse (skipTest );
87- // No runOn syntax for legacy CRUD, so skipping these manually for now
88- assumeFalse (isSharded () && description .startsWith ("Aggregate with $currentOp" ));
87+ assumeFalse (isSharded ());
8988
9089 collectionHelper = new CollectionHelper <Document >(new DocumentCodec (), new MongoNamespace (databaseName , collectionName ));
9190 collectionHelper .killAllSessions ();
@@ -128,17 +127,16 @@ public void shouldPassAllOutcomes() {
128127 if (definition .containsKey ("operation" )) {
129128 runOperation (expectedOutcome , definition .getDocument ("operation" ),
130129 expectedOutcome .containsKey ("result" ) && expectedOutcome .isDocument ("result" )
131- ? expectedOutcome .get ("result" ). asDocument () : null );
130+ ? expectedOutcome .get ("result" ) : null );
132131 } else { // v2 test
133132 BsonArray operations = definition .getArray ("operations" );
134133 for (BsonValue operation : operations ) {
135- runOperation (expectedOutcome , operation .asDocument (),
136- operation .asDocument ().containsKey ("result" ) ? operation .asDocument ().getDocument ("result" ) : null );
134+ runOperation (expectedOutcome , operation .asDocument (), operation .asDocument ().get ("result" , null ));
137135 }
138136 }
139137 }
140138
141- private void runOperation (final BsonDocument expectedOutcome , final BsonDocument operation , final BsonDocument expectedResult ) {
139+ private void runOperation (final BsonDocument expectedOutcome , final BsonDocument operation , final BsonValue expectedResult ) {
142140 BsonDocument outcome = null ;
143141 boolean wasException = false ;
144142 try {
@@ -189,7 +187,7 @@ public static Collection<Object[]> data() throws URISyntaxException, IOException
189187 data .add (new Object []{file .getName (), test .asDocument ().getString ("description" ).getValue (),
190188 testDocument .getString ("database_name" , new BsonString (getDefaultDatabaseName ())).getValue (),
191189 testDocument .getString ("collection_name" , new BsonString ("test" )).getValue (),
192- testDocument .getArray ("data" ), test .asDocument (), skipTest (testDocument , test .asDocument ())});
190+ testDocument .getArray ("data" , new BsonArray () ), test .asDocument (), skipTest (testDocument , test .asDocument ())});
193191 }
194192 }
195193 return data ;
0 commit comments