Skip to content

Instantly share code, notes, and snippets.

@mefesto
Created October 3, 2012 21:10
Show Gist options
  • Select an option

  • Save mefesto/3829868 to your computer and use it in GitHub Desktop.

Select an option

Save mefesto/3829868 to your computer and use it in GitHub Desktop.
(deftest test-store-if-not-modified
(let [bucket-name "clojurewerkz.welle.kv"
key "none-modified-key"
_ (kv/store bucket-name key "value1")
res (kv/fetch-one bucket-name key)
tstamp (:last-modified res)
_ (kv/store bucket-name key "value2")
_ (kv/store bucket-name key "value3"
:last-modified (.getTime tstamp)
:if-not-modified true)
res (kv/fetch-one bucket-name key)]
(is (= "value2" (String. ^bytes (:value res))))
(drain bucket-name)))
ERROR in (test-store-if-not-modified) (DateUtils.java:196)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.IllegalArgumentException: date is null
at org.apache.http.impl.cookie.DateUtils.formatDate (DateUtils.java:196)
org.apache.http.impl.cookie.DateUtils.formatDate (DateUtils.java:179)
com.basho.riak.client.http.request.RequestMeta.setIfUnmodifiedSince (RequestMeta.java:247)
com.basho.riak.client.raw.http.ConversionUtil.convert (ConversionUtil.java:227)
com.basho.riak.client.raw.http.HTTPClientAdapter.store (HTTPClientAdapter.java:229)
com.basho.riak.client.raw.ClusterClient.store (ClusterClient.java:127)
clojurewerkz.welle.kv$store.doInvoke (kv.clj:36)
clojure.lang.RestFn.invoke (RestFn.java:573)
clojurewerkz.welle.test.kv_test/fn (kv_test.clj:259)
clojure.test$test_var$fn__6926.invoke (test.clj:701)
clojure.test$test_var.invoke (test.clj:701)
user$eval3825$test_var_with_selector__3829.invoke (NO_SOURCE_FILE:1)
clojure.lang.AFn.applyToHelper (AFn.java:163)
clojure.lang.AFn.applyTo (AFn.java:151)
clojure.core$apply.invoke (core.clj:603)
leiningen.core.injected$compose_hooks$fn__9.doInvoke (NO_SOURCE_FILE:1)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invoke (core.clj:601)
leiningen.core.injected$run_hooks.invoke (NO_SOURCE_FILE:1)
leiningen.core.injected$prepare_for_hooks$fn__14$fn__15.doInvoke (NO_SOURCE_FILE:1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment