Skip to content

Commit

Permalink
[lint] Fix redundant let expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Philippart committed Jun 1, 2022
1 parent 6b89c67 commit 6b8f3a5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
30 changes: 15 additions & 15 deletions test/jackdaw/serdes/avro/integration_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@
(let [serde ^Serde (avro/serde +type-registry+ +mock-schema-registry+ +topic-config+)]
(let [msg {:customer-id (uuid/v4)
:address {:value "foo"
:key-path "foo.bar.baz"}}]
(let [serialized (-> (.serializer serde)
(.serialize "foo" msg))
deserialized (-> (.deserializer serde)
(.deserialize "foo" serialized))]
(is (= deserialized msg)))))))
:key-path "foo.bar.baz"}}
serialized (-> (.serializer serde)
(.serialize "foo" msg))
deserialized (-> (.deserializer serde)
(.deserialize "foo" serialized))]
(is (= deserialized msg))))))

(deftest ^:integration real-schema-registry
(fix/with-fixtures [(fix/service-ready? {:http-url +real-schema-registry-url+
:http-timeout 5000})]
(testing "schema registry set in config"
(let [serde ^Serde (avro/serde +type-registry+ +real-schema-registry+ +topic-config+)]
(let [msg {:customer-id (uuid/v4)
:address {:value "foo"
:key-path "foo.bar.baz"}}]
(let [serialized (-> (.serializer serde)
(.serialize "foo" msg))
deserialized (-> (.deserializer serde)
(.deserialize "foo" serialized))]
(is (= deserialized msg))))))))
(let [serde ^Serde (avro/serde +type-registry+ +real-schema-registry+ +topic-config+)
msg {:customer-id (uuid/v4)
:address {:value "foo"
:key-path "foo.bar.baz"}}
serialized (-> (.serializer serde)
(.serialize "foo" msg))
deserialized (-> (.deserializer serde)
(.deserialize "foo" serialized))]
(is (= deserialized msg))))))

;;;; Client integration tests against real Kafka through a real topic

Expand Down
28 changes: 14 additions & 14 deletions test/jackdaw/test/transports/rest_proxy_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@
(assoc :group-config {:auto.offset.reset "earliest"
:fetch.min.bytes 100
:consumer.fetch.timeout.ms 200})))
(proxy/with-consumer))]
(let [[url options] (first @http-reqs)]
(is (= "http://localhost:8082/consumers/test-group-config" url))
(is (= {"Accept" "application/vnd.kafka.v2+json"
"Content-Type" "application/vnd.kafka.v2+json"}
(:headers options)))
(is (= {"auto.offset.reset" "earliest"
"fetch.min.bytes" 100
"consumer.fetch.timeout.ms" 200}
(-> (:body options)
(json/read-str)
(select-keys ["auto.offset.reset"
"fetch.min.bytes"
"consumer.fetch.timeout.ms"])))))))))
(proxy/with-consumer))
[url options] (first @http-reqs)]
(is (= "http://localhost:8082/consumers/test-group-config" url))
(is (= {"Accept" "application/vnd.kafka.v2+json"
"Content-Type" "application/vnd.kafka.v2+json"}
(:headers options)))
(is (= {"auto.offset.reset" "earliest"
"fetch.min.bytes" 100
"consumer.fetch.timeout.ms" 200}
(-> (:body options)
(json/read-str)
(select-keys ["auto.offset.reset"
"fetch.min.bytes"
"consumer.fetch.timeout.ms"]))))))))

0 comments on commit 6b8f3a5

Please sign in to comment.