changed the test for index names since they don't seem to be consistent

This commit is contained in:
Thomas Risberg
2011-09-01 17:52:21 -04:00
parent c15263a259
commit 9bb42245bb

View File

@@ -251,7 +251,7 @@ public class MappingTests {
public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException {
List<DBObject> indexes = collection.getIndexInfo();
for (DBObject dbo : indexes) {
if ("name".equals(dbo.get("name"))) {
if (dbo.get("name") != null && dbo.get("name") instanceof String && ((String)dbo.get("name")).startsWith("name")) {
return true;
}
}
@@ -267,7 +267,7 @@ public class MappingTests {
public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException {
List<DBObject> indexes = collection.getIndexInfo();
for (DBObject dbo : indexes) {
if ("name_1".equals(dbo.get("name"))) {
if (dbo.get("name") != null && dbo.get("name") instanceof String && ((String)dbo.get("name")).startsWith("name")) {
return true;
}
}