Browse Source

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

pull/1/head
Thomas Risberg 15 years ago
parent
commit
9bb42245bb
  1. 4
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/MappingTests.java

4
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/MappingTests.java

@ -251,7 +251,7 @@ public class MappingTests {
public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException { public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException {
List<DBObject> indexes = collection.getIndexInfo(); List<DBObject> indexes = collection.getIndexInfo();
for (DBObject dbo : indexes) { 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; return true;
} }
} }
@ -267,7 +267,7 @@ public class MappingTests {
public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException { public Boolean doInCollection(DBCollection collection) throws MongoException, DataAccessException {
List<DBObject> indexes = collection.getIndexInfo(); List<DBObject> indexes = collection.getIndexInfo();
for (DBObject dbo : indexes) { 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; return true;
} }
} }

Loading…
Cancel
Save