          (is (= expected-etag (response-etag response-with-tag))
              "unexpected etag returned for request with prior etag"))))))
 
+(defn create-jruby-instance-with-mock-transports-info
+  [wait-atom transports-info-atom config]
+  (let [puppet-config (jruby-testutils/mock-puppet-config-settings
+                       (:jruby-puppet config))]
+    (reify JRubyPuppet
+      (getSetting [_ setting]
+        (get puppet-config setting))
+      (getClassInfoForEnvironment [_ _]
+        (let [class-info {"/some/file" {"classes" "foo"}}]
+          class-info))
+      (getTransportInfoForEnvironment [_ _]
+        (let [a (ArrayList.)]
+          (.add a @transports-info-atom)
+          (when-let [promises @wait-atom]
+            (deliver (:wait-promise promises) true)
+            @(:continue-promise promises))
+          a))
+      (handleRequest [_ _]
+        (JRubyPuppetResponse. 0 nil nil nil))
+      (puppetVersion [_]
+        "1.2.3")
+      (terminate [_]
+        (log/info "Terminating Master")))))
+
 (deftest ^:integration transports-info-updated-after-cache-flush-during-prior-request
-  (let [transports-info-atom (atom [{:name "transport1"}])
+  (let [transports-info-atom (atom {:name "transport1"})
         wait-atom (atom nil)
         config (bootstrap/load-dev-config-with-overrides
                 {:jruby-puppet {:gem-path gem-path

(def schema2-serialized
  {:name "another_device"
   :desc "Connects to a network device"
   :connection_info
   {:username
    {:type "String"

       (is (true? (deref wait-promise 10000 :timed-out))
           (str "timed out waiting for get transports info call to be reached "
                "in mock jrubypuppet instance"))
       (reset! transports-info-atom {:name "transport2"})
       (purge-env-cache "production")
       (deliver continue-promise true)
       (let [initial-response @initial-response-future
