diff --git a/test/monger/test/lib_integration.clj b/test/monger/test/lib_integration.clj index 0f5a3d5..891165c 100644 --- a/test/monger/test/lib_integration.clj +++ b/test/monger/test/lib_integration.clj @@ -5,14 +5,18 @@ [monger.conversion]) (:import [org.joda.time DateTime ReadableInstant] [org.joda.time.format ISODateTimeFormat] - [java.io StringWriter PrintWriter]) + [java.io StringWriter PrintWriter] + [org.bson.types ObjectId]) (:require [clojure.data.json :as json] [clj-time.core :as t])) -(deftest serialization-of-joda-datetime-to-json +(deftest serialization-of-joda-datetime-to-json-with-clojure-data-json (is (= "\"2011-10-13T23:55:00.000Z\"" (json/json-str (t/date-time 2011 10 13 23 55 0))))) +(deftest serialization-of-object-id-to-json-with-clojure-data-json + (is (= "\"4ec2d1a6b55634a935ea4ac8\"" (json/json-str (ObjectId. "4ec2d1a6b55634a935ea4ac8"))))) + (deftest conversion-of-joda-datetime-to-db-object (let [d (to-db-object (t/date-time 2011 10 13 23 55 0))]