         (with-redefs [api/create-jobs! (fn [in-conn _]
                                          (is (= conn in-conn))
                                          (throw (ex-info "Transaction timed out."
-                                                         {:db.error :db.error/transaction-timeout})))
-                      rate-limit/job-submission-rate-limiter rate-limit/AllowAllRateLimiter]
+                                                         {:db.error :db.error/transaction-timeout})))]
 
           (let [handler (api/create-jobs-handler conn task-constraints gpu-enabled? is-authorized-fn)
                 {:keys [body status]} (handler (new-request))]

                       :authorization/user "user"
                       :headers {"Content-Type" "application/json"}
                       :body-params {:jobs [(minimal-job)]}})]
    (with-redefs [api/no-job-exceeds-quota? (constantly true)]
      (testing "successful-job-creation-response"
        (with-redefs [api/create-jobs! (fn [in-conn _]
                                         (is (= conn in-conn)))
                      rate-limit/job-submission-rate-limiter rate-limit/AllowAllRateLimiter]
          (let [handler (api/create-jobs-handler conn task-constraints gpu-enabled? is-authorized-fn)
                {:keys [status]} (handler (new-request))]
            (is (= 201 status)))))

      (testing "generic-exception-job-creation-response"
        (with-redefs [api/create-jobs! (fn [in-conn _]
                                         (is (= conn in-conn))
                                         (throw (Exception. "Thrown from test")))]
          (let [handler (api/create-jobs-handler conn task-constraints gpu-enabled? is-authorized-fn)
                {:keys [body status]} (handler (new-request))]
            (is (= 500 status))
            (is (str/includes? body "Exception occurred while creating job - Thrown from test")))))

      (testing "should fail with duplicate uuids"
        (let [conn (restore-fresh-database! "datomic:mem://mesos-api-test")
              {:keys [uuid] :as j1} (minimal-job)
              j2 (assoc (minimal-job) :uuid uuid)
              j3 (minimal-job)
              request (assoc-in (new-request) [:body-params :jobs] [j1 j2 j3])
              handler (api/create-jobs-handler conn task-constraints gpu-enabled? is-authorized-fn)
              {:keys [body status]} (handler request)]
          (is (= 400 status))
          (is (str/includes? body (str uuid)))
          (is (not (str/includes? body (str (:uuid j3))))))))))

(deftest test-validate-partitions
  (is (api/validate-partitions {:dataset {"foo" "bar"}}))
