use of org.mongojack.ObjectId in project graylog2-server by Graylog2.
the class ESMongoDateTimeDeserializerTest method deserializeMongoDateTime.
@Test
@MongoDBFixtures("DateTime.json")
public void deserializeMongoDateTime() throws Exception {
final DBCollection date_collection = mongodb.mongoConnection().getDatabase().getCollection("date_collection");
final JacksonDBCollection<DTO, ObjectId> db = JacksonDBCollection.wrap(date_collection, DTO.class, ObjectId.class, objectMapper, null);
final DTO value = db.findOne();
assertThat(value.dateTime).isEqualTo(new DateTime(2019, 1, 13, 14, 0, DateTimeZone.UTC));
}
Aggregations