diff --git a/src/jackdaw/data/admin.clj b/src/jackdaw/data/admin.clj index 2e753ddc..61ef07df 100644 --- a/src/jackdaw/data/admin.clj +++ b/src/jackdaw/data/admin.clj @@ -16,7 +16,6 @@ (ConfigEntry. k (:value v)))) (defn->data ConfigEntry->data - "" [^ConfigEntry e] {:name (.name e) :value (.value e) @@ -27,13 +26,11 @@ ;;; Config (defn map->Config - "" ^Config [m] (Config. (map (partial apply ->ConfigEntry) m))) (defn->data Config->data - "" [^Config c] (into {} (comp (map ConfigEntry->data) @@ -44,7 +41,6 @@ ;;; TopicDescription (defn->data TopicDescription->data - "" [^TopicDescription td] {:is-internal? (.isInternal td) :partition-info (map datafy (.partitions td))}) @@ -52,7 +48,6 @@ ;;; NewTopic (defn map->NewTopic - "" [{:keys [:topic-name :partition-count :replication-factor @@ -71,7 +66,6 @@ ;;;; Result types (defn->data DescribeClusterResult->data - "" [^DescribeClusterResult dcr] {:cluster-id (-> dcr .clusterId .get) :controller (-> dcr .controller .get datafy) diff --git a/src/jackdaw/data/common.clj b/src/jackdaw/data/common.clj index 4ecfb01c..5472fdc0 100644 --- a/src/jackdaw/data/common.clj +++ b/src/jackdaw/data/common.clj @@ -10,7 +10,6 @@ ;;; Node (defn->data Node->data - "" [^Node node] {:host (.host node) :port (.port node) @@ -31,7 +30,6 @@ ;;; TopicPartitionInfo (defn->data TopicPartitionInfo->data - "" [^TopicPartitionInfo tpi] {:isr (mapv datafy (.isr tpi)) :leader (datafy (.leader tpi)) diff --git a/src/jackdaw/data/common_config.clj b/src/jackdaw/data/common_config.clj index d6044f4e..e4d6bb24 100644 --- a/src/jackdaw/data/common_config.clj +++ b/src/jackdaw/data/common_config.clj @@ -8,15 +8,12 @@ ;;; ConfigResource.Type (def +broker-config-resource-type+ - "" ConfigResource$Type/BROKER) (def +topic-config-resource-type+ - "" ConfigResource$Type/TOPIC) (def +unknown-config-resource-type+ - "" ConfigResource$Type/UNKNOWN) (defn ->ConfigResourceType [o] @@ -26,7 +23,6 @@ +unknown-config-resource-type+)) (defn->data ConfigResourceType->data - "" [^ConfigResource$Type crt] (cond (= +broker-config-resource-type+ crt) :config-resource/broker @@ -40,22 +36,18 @@ ;;; ConfigResource (defn ->ConfigResource - "" [^ConfigResource$Type type ^String name] (ConfigResource. type name)) (defn ->topic-resource - "" [name] (->ConfigResource +topic-config-resource-type+ name)) (defn ->broker-resource - "" [name] (->ConfigResource +broker-config-resource-type+ name)) (defn->data ConfigResource->data - "" [^ConfigResource cr] {:name (.name cr) :type (datafy (.type cr))}) diff --git a/src/jackdaw/streams/specs.clj b/src/jackdaw/streams/specs.clj index 593cf0b9..bb3ae095 100644 --- a/src/jackdaw/streams/specs.clj +++ b/src/jackdaw/streams/specs.clj @@ -1,5 +1,4 @@ (ns jackdaw.streams.specs - "" {:license "BSD 3-Clause License "} (:require [clojure.spec.alpha :as s] [jackdaw.specs] diff --git a/src/jackdaw/test/commands.clj b/src/jackdaw/test/commands.clj index 728249ca..8ae9c498 100644 --- a/src/jackdaw/test/commands.clj +++ b/src/jackdaw/test/commands.clj @@ -1,5 +1,4 @@ (ns jackdaw.test.commands - "" (:require [clojure.spec.alpha :as s] [jackdaw.test.commands.base :as base] diff --git a/src/jackdaw/test/fixtures.clj b/src/jackdaw/test/fixtures.clj index 09ed3c8c..67c03a16 100644 --- a/src/jackdaw/test/fixtures.clj +++ b/src/jackdaw/test/fixtures.clj @@ -1,5 +1,4 @@ (ns jackdaw.test.fixtures - "" (:require [aleph.http :as http] [clojure.java.io :as io] diff --git a/src/jackdaw/test/journal.clj b/src/jackdaw/test/journal.clj index 459414a7..d703ee84 100644 --- a/src/jackdaw/test/journal.clj +++ b/src/jackdaw/test/journal.clj @@ -1,5 +1,4 @@ (ns jackdaw.test.journal - "" (:require [clojure.set :refer [subset?]] [clojure.tools.logging :as log] @@ -56,9 +55,9 @@ (get m topic))) (defn journal-result - [machine record] "Journals the `record` in the appropriate place in the supplied test machine's `:journal`" + [machine record] (let [journal (:journal machine)] (if-let [err (agent-error journal)] (throw err) @@ -122,27 +121,30 @@ [journal topic-name ks value] (messages-by-kv-fn journal topic-name ks #(= value %))) -(defn by-key [topic-name ks value] +(defn by-key "Returns the first message in the topic where attribute 'ks' is equal to 'value'. Can be combined with the :watch command to assert that a message has been published: [:watch (j/by-key :result-topic [:object :color] \"red\")]" + [topic-name ks value] (fn [journal] (first (messages-by-kv journal topic-name ks value)))) -(defn by-keys [topic-name ks values] +(defn by-keys "Returns all of the messages in the topic where attribute 'ks' is equal to one of the values. Can be combined with the :watch command to assert that messages have been published: [:watch (j/by-key :result-topic [:object :color] #{\"red\" \"green\" \"blue\"})]" + [topic-name ks values] (fn [journal] (messages-by-kv-fn journal topic-name ks (set values)))) -(defn by-id [topic-name value] +(defn by-id "Returns all of the messages in the topic with an id of `value`. Can be combined with the :watch command to assert that a message with the supplied id has been published: [:watch (j/by-id :result-topic 123)]" + [topic-name value] (by-key topic-name [:id] value)) (defn all-keys-present diff --git a/test/jackdaw/test/fixtures_test.clj b/test/jackdaw/test/fixtures_test.clj index 9684fd52..9e6875ad 100644 --- a/test/jackdaw/test/fixtures_test.clj +++ b/test/jackdaw/test/fixtures_test.clj @@ -34,7 +34,6 @@ (is (topic-exists? client topic-foo))))) (defn test-resetter - "" {:style/indent 1} [{:keys [app-config reset-params reset-fn]} assertion-fn] (let [reset-args (atom [])