Made integration test less aggressive in cleaning up to avoid inter-test collisions.

This commit is contained in:
Oliver Gierke
2011-07-07 19:52:16 +02:00
parent a2687b6688
commit 2e3f2c602c

View File

@@ -49,7 +49,20 @@ public class RepositoryIndexCreationIntegrationTests {
@After
public void tearDown() {
operations.dropCollection(Person.class);
operations.execute(Person.class, new CollectionCallback<Void>() {
public Void doInCollection(DBCollection collection) throws MongoException, DataAccessException {
for (DBObject index : collection.getIndexInfo()) {
String indexName = index.get("name").toString();
if (indexName.startsWith("find")) {
collection.dropIndex(indexName);
}
}
return null;
}
});
}
@Test