   (:use clojure.test
         mdr2.archive))
 
-(defn mock-jdbc-insert [db table job] job)
+(def mock-db (atom ()))
+
+(defn mock-jdbc-insert [db table job]
+  (reset! mock-db job))
 
 (deftest test-archiving
   (testing "container id"


  (testing "add master to db"
    (with-redefs [clojure.java.jdbc/insert! mock-jdbc-insert]
      (is (= (add-to-db {:id 123})
             {:verzeichnis "dam123",
              :sektion "master",
              :aktion "save",


  (testing "add iso to db"
    (with-redefs [clojure.java.jdbc/insert! mock-jdbc-insert]
      (is (= (do
               (add-to-db {:id 123 :iso-path "foo"})
               @mock-db)
             {:verzeichnis "ds123",
              :sektion "cdimage",
              :aktion "save",
              :transaktions_status "pending",
              :abholer "NN",
