1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-21 05:31:42 +00:00

DB update script 6

This commit is contained in:
jendib
2013-08-20 18:55:49 +02:00
parent 00b00f0d0c
commit 906de329ae
7 changed files with 17 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ public class TestJpa extends BaseTransactionalTest {
user.setEmail("toto@docs.com");
user.setLocaleId("fr");
user.setRoleId("admin");
user.setPrivateKey("AwesomePrivateKey");
String id = userDao.create(user);
TransactionUtil.commit();

View File

@@ -31,6 +31,12 @@ public class TestEncryptUtil {
@Test
public void encryptStreamTest() throws Exception {
try {
EncryptionUtil.encryptStream(this.getClass().getResourceAsStream("/file/udhr.pdf"), "");
Assert.fail();
} catch (IllegalArgumentException e) {
// NOP
}
InputStream inputStream = EncryptionUtil.encryptStream(this.getClass().getResourceAsStream("/file/udhr.pdf"), pk);
byte[] encryptedData = Streams.readAll(inputStream);
byte[] assertData = Streams.readAll(this.getClass().getResourceAsStream("/file/udhr_encrypted.pdf"));