@Test public void givenKnownEncryptedObjectWhenCallingDecryptAnnotatedMethodThenAllOfTheObjectAttributesMustBePlainText() { long startTime = System.currentTimeMillis(); Account expected = integrationTest.encryptMe(EXPECTED_ACCOUNT); LOGGER.debug("Decryption took: " + (System.currentTimeMillis() - startTime) + " ms"); LOGGER.debug("Expected: " + expected); expected = integrationTest.decryptMe(expected); assertTrue(expected.getId().equals(EXPECTED_ID)); assertTrue(expected.getName().equals(EXPECTED_NAME)); assertTrue(expected.getAddress().equals(EXPECTED_ADDRESS)); }
@Test public void givenKnownPopulatedAttributesOfObjectWhenCallingEncryptAnnotatedMethodThenAllOfTheObjectAttributesMustBeEncrypted() { long startTime = System.currentTimeMillis(); Account expected = integrationTest.encryptMeWithSpecifiedAttributes(EXPECTED_ACCOUNT); LOGGER.debug("Encryption took: " + (System.currentTimeMillis() - startTime) + " ms"); assertTrue(expected.getId().equals(EXPECTED_ID)); assertFalse(expected.getName().equals(EXPECTED_NAME)); assertFalse(expected.getAddress().equals(EXPECTED_ADDRESS)); }