use of com.google.crypto.tink.testing.TestUtil.DummyAead in project tink by google.
the class AeadOrDaeadTest method testWithAeadPrimitive.
@Test
public void testWithAeadPrimitive() {
AeadOrDaead aeadOrDaead = new AeadOrDaead(new DummyAead());
// Test that encrypt and decrypt is called on the DummyAead.
GeneralSecurityException thrown = assertThrows(GeneralSecurityException.class, () -> aeadOrDaead.encrypt(TEST_BYTE_VECTOR, TEST_BYTE_VECTOR));
assertThat(thrown).hasMessageThat().contains("dummy");
thrown = assertThrows(GeneralSecurityException.class, () -> aeadOrDaead.decrypt(TEST_BYTE_VECTOR, TEST_BYTE_VECTOR));
assertThat(thrown).hasMessageThat().contains("dummy");
}
Aggregations