Created
April 21, 2016 11:25
-
-
Save lbradstreet/4fe2af7ceefcc734bfca29b14871328b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns onyx.plugin.http-output-gzip-test | |
(:require [clojure.core.async :refer [go chan >! >!! <!! close!]] | |
[clojure.test :refer [deftest is]] | |
[taoensso.timbre :refer [info]] | |
[onyx.test-helper :refer [with-test-env]] | |
[onyx.plugin.core-async :refer [take-segments!]] | |
[onyx.plugin.http-output] | |
[qbits.jet.server] | |
[onyx.api]) | |
(:import [java.util.zip GZIPOutputStream] | |
[java.io ByteArrayOutputStream])) | |
(defn str->gzip [s encoding] | |
(let [baos (ByteArrayOutputStream.) | |
gzos (GZIPOutputStream. baos)] | |
(.write gzos (.getBytes s encoding)) | |
(.close gzos) | |
(.toByteArray baos))) | |
(def messages | |
[{:url "http://localhost:41300/" :args {:body (str->gzip "d=3" "UTF-8") | |
:as :json | |
:headers {"Content-Type" "application/json" | |
"Content-Encoding" "gzip"}}} | |
:done]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment