Skip to content

Commit

Permalink
*serializable-whitelist*: add quarantine test
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Sep 10, 2020
1 parent e5a614b commit a90551d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/taoensso/nippy/tests/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@

"Can freeze and thaw Serializable object if approved by whitelist")

(is
(false?
(get-in
(binding [nippy/*serializable-whitelist* #{}]
(nippy/thaw
(binding [nippy/*serializable-whitelist* #{"java.util.concurrent.Semaphore"}]
(nippy/freeze (java.util.concurrent.Semaphore. 1)))))
[:nippy/unthawable :serializable-whitelist-pass?]))

"Thaw will quarantine Serializable objects approved when freezing.")

(is
(instance? java.util.concurrent.Semaphore
(binding [nippy/*serializable-whitelist* #{"java.util.concurrent.*"}]
Expand Down

0 comments on commit a90551d

Please sign in to comment.