|
1 | 1 | (ns kinsky.client-test |
2 | | - (:require [clojure.test :refer :all :as t] |
| 2 | + (:require [clojure.test :refer :all :as t] |
3 | 3 | [clojure.pprint :as pp] |
4 | 4 | [kinsky.client :as client] |
5 | 5 | [kinsky.embedded :as e])) |
|
32 | 32 | (testing "string serializer" |
33 | 33 | (is (= "foo" |
34 | 34 | (String. |
35 | | - (.serialize (client/string-serializer) "" "foo"))))) |
| 35 | + (.serialize (client/string-serializer) "" "foo"))))) |
36 | 36 |
|
37 | 37 | (testing "keyword serializer" |
38 | 38 | (is (= "foo" |
39 | 39 | (String. |
40 | | - (.serialize (client/keyword-serializer) "" :foo))))) |
| 40 | + (.serialize (client/keyword-serializer) "" :foo))))) |
41 | 41 |
|
42 | 42 | (testing "edn serializer" |
43 | 43 | (is (= "{:a :b, :c :d}" |
44 | 44 | (String. |
45 | | - (.serialize (client/edn-serializer) "" {:a :b :c :d}))))) |
| 45 | + (.serialize (client/edn-serializer) "" {:a :b :c :d}))))) |
46 | 46 |
|
47 | 47 | (testing "json serializer" |
48 | 48 | (is (= "[0,1,2]" |
49 | 49 | (String. |
50 | | - (.serialize (client/json-serializer) "" [0 1 2])))))) |
| 50 | + (.serialize (client/json-serializer) "" [0 1 2])))))) |
51 | 51 |
|
52 | 52 | (deftest deserializer |
53 | 53 | (testing "string deserializer" |
|
69 | 69 | (.getBytes "{\"a\": \"b\", \"c\": \"d\"}")))))) |
70 | 70 |
|
71 | 71 | (deftest config-props |
72 | | - (testing "valid configuration properties" |
73 | | - (is (= {"foo.bar" "0"} |
74 | | - (client/opts->props {:foo.bar 0}))))) |
| 72 | + (testing "configuration properties" |
| 73 | + (is (= {"foo.bar" "0" "foo.baz" "1"} |
| 74 | + (client/opts->props {:foo.bar 0 |
| 75 | + "foo.baz" "1" |
| 76 | + :qualified/kw :discarded}))))) |
75 | 77 |
|
76 | 78 | (deftest rebalance-listener |
77 | | - (testing "idempotency" |
| 79 | + (testing "identity when given a ConsumerRebalanceListener" |
78 | 80 | (let [sink (client/rebalance-listener (fn [& _]))] |
79 | 81 | (is (= sink (client/rebalance-listener sink))))) |
80 | 82 |
|
|
0 commit comments