*serializable-whitelist*: add quarantine test
This commit is contained in:
parent
e5a614bd9b
commit
a90551d40c
1 changed files with 11 additions and 0 deletions
|
|
@ -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.*"}]
|
||||
|
|
|
|||
Loading…
Reference in a new issue