@Test
public void canHandleObjectSerializedAsAPrimitive() throws Exception {
Mapping mapping = new Mapping.Builder().addSerializer(Friend.class, new PrimitiveJsonSerializer()).build();
factory = new BsonQueryFactory(new JacksonEngine(mapping));
DBObject query = factory.createQuery("{bytes:#}", new Friend("Robert")).toDBObject();
assertThat(query.get("bytes")).isEqualTo("Robert");
}