Permalink
Browse files

[#574] Test case for AES

  • Loading branch information...
1 parent 1267e80 commit af6182cb172fc6ea5c22066eca17176e4d6d6e7a @erwan erwan committed Jun 28, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 framework/src/play/src/test/scala/play/api/libs/CryptoSpec.scala
View
17 framework/src/play/src/test/scala/play/api/libs/CryptoSpec.scala
@@ -0,0 +1,17 @@
+package play.api.libs
+
+import org.specs2.mutable._
+import play.api.libs._
+
+object CryptoSpec extends Specification {
+
+ "Crypto api" should {
+ "be able to encrypt/decrypt text using AES algorithm" in {
+ val text = "Play Framework 2.0"
+ val key = "0123456789abcdef"
+ Crypto.decryptAES(Crypto.encryptAES(text, key), key) must be equalTo text
+ }
+ }
+
+}
+

0 comments on commit af6182c

Please sign in to comment.