From 92386aa9cf65072bc7a083d0a1c8d98bbbfc299f Mon Sep 17 00:00:00 2001 From: Rob Hanlon Date: Tue, 4 Aug 2020 12:17:07 -0700 Subject: [PATCH] Cleanup, ensure Clojure types instead of Java types --- src/clj_test_containers/core.clj | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/clj_test_containers/core.clj b/src/clj_test_containers/core.clj index da2d7f5..7f579da 100644 --- a/src/clj_test_containers/core.clj +++ b/src/clj_test_containers/core.clj @@ -16,22 +16,22 @@ [{:keys [container exposed-ports env-vars command]}] (.setExposedPorts container (map int exposed-ports)) - (when (some? env-vars) - (doseq [pair env-vars] - (.addEnv container (first pair) (second pair)))) + (run! (fn [[k v]] (.addEnv container k v)) env-vars) - (when (some? command) + (when command (.setCommand container command)) {:container container - :exposed-ports (.getExposedPorts container) - :env-vars (.getEnvMap container) + :exposed-ports (vec (.getExposedPorts container)) + :env-vars (into {} (.getEnvMap container)) :host (.getHost container)}) (defn create "Creates a generic testcontainer and sets its properties" [{:keys [image-name] :as options}] - (init (assoc options :container (GenericContainer. image-name)))) + (->> (GenericContainer. image-name) + (assoc options :container) + init)) (defn map-classpath-resource! "Maps a resource in the classpath to the given container path. Should be called before starting the container!"