 ;;                                                                            ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+
 (defmacro with-mock-send-events [publish & body]
   `(with-redefs [samsara.client2/send-events (fn [& args#] args#)]
      (let [[~'url ~'headers ~'body ~'opts] ~publish]

(ns samsara.client-test
  (:require [samsara.client2 :refer :all]
            [midje.sweet :refer :all]))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(fact "publish-events: should post the given events to the ingestion-api"

      ;; successful post of a single event
      (with-mock-send-events
        (publish-events "http://localhost:9000/v1"
                        [{:eventName "a" :timestamp 1 :sourceId "d1"}])
