Exemplo n.º 1
0
 @Test
 public void testHighestEncryptionModeWithoutPassword() {
   try {
     builder.setEncryptionMethod(HawkBuilder.EncryptionMethod.HIGHEST).build();
     fail();
   } catch (Exception e) {
     assertThat(e).hasMessage("Password cannot be null " + "if encryption mode is highest");
   }
 }
Exemplo n.º 2
0
 @Test
 public void testNoEncrpytionMode() {
   builder.setEncryptionMethod(HawkBuilder.EncryptionMethod.NO_ENCRYPTION).build();
   assertThat(builder.getEncryptionMethod()).isEqualTo(HawkBuilder.EncryptionMethod.NO_ENCRYPTION);
 }
Exemplo n.º 3
0
 @Test
 public void testHighestEncryptionMethodWithPasword() {
   builder.setEncryptionMethod(HawkBuilder.EncryptionMethod.HIGHEST).setPassword("test");
   assertThat(builder.getEncryptionMethod()).isEqualTo(HawkBuilder.EncryptionMethod.HIGHEST);
 }