use of com.querydsl.core.types.dsl.BooleanOperation in project spring-data-mongodb by spring-projects.
the class SpringDataMongodbSerializerUnitTests method convertsIdPropertyCorrectly.
// DATAMONGO-467
@Test
public void convertsIdPropertyCorrectly() {
ObjectId id = new ObjectId();
PathBuilder<Address> builder = new PathBuilder<Address>(Address.class, "address");
StringPath idPath = builder.getString("id");
DBObject result = (DBObject) serializer.visit((BooleanOperation) idPath.eq(id.toString()), (Void) null);
assertThat(result.get("_id"), is(notNullValue()));
assertThat(result.get("_id"), is(instanceOf(ObjectId.class)));
assertThat(result.get("_id"), is((Object) id));
}
Aggregations