Skip to content

Commit 072c95e

Browse files
committed
Refactor
1 parent 67dcb1f commit 072c95e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdk1/src/test/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/DynamoDBEncryptorTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import java.util.Collection;
4747
import java.util.Collections;
4848
import java.util.HashMap;
49+
import java.util.TreeMap;
4950
import java.util.HashSet;
5051
import java.util.Map;
5152
import java.util.Set;
@@ -198,15 +199,16 @@ public void ensureEncryptedAttributesUnmodified() throws GeneralSecurityExceptio
198199
Map<String, AttributeValue> encryptedAttributes =
199200
encryptor.encryptAllFieldsExcept(
200201
Collections.unmodifiableMap(attribs), context, "hashKey", "rangeKey", "version");
201-
Map<String, AttributeValue> beforeDecryption = new HashMap<>(encryptedAttributes);
202+
String beforeDecryption = (new TreeMap<>(encryptedAttributes)).toString();
202203
encryptor.decryptAllFieldsExcept(
203204
Collections.unmodifiableMap(encryptedAttributes),
204205
context,
205206
"hashKey",
206207
"rangeKey",
207208
"version");
209+
String afterDecryption = (new TreeMap<>(encryptedAttributes)).toString();
208210

209-
assertEquals(beforeDecryption, encryptedAttributes);
211+
assertEquals(beforeDecryption, afterDecryption);
210212
}
211213

212214
@Test(expectedExceptions = SignatureException.class)

0 commit comments

Comments
 (0)