testcontainers-clj/test/clj_test_containers/core_test.clj
2020-06-04 13:04:30 +02:00

16 lines
758 B
Clojure

(ns clj-test-containers.core-test
(:require [clojure.test :refer :all]
[clj-test-containers.core :refer :all]))
(deftest init-test
(testing "Testing basic testcontainer generic image initialisation"
(let [container (create {:image-name "postgres:12.2"
:exposed-ports [5432]
:env-vars {"POSTGRES_PASSWORD" "pw"}})
initialized-container (start container)
stopped-container (stop container)]
(is (some? (:id initialized-container)))
(is (some? (:mapped-ports initialized-container)))
(is (some? (get (:mapped-ports initialized-container) 5432)))
(is (nil? (:id stopped-container)))
(is (nil? (:mapped-ports stopped-container))))))