From ff493ba434744f19c76ee6b71b8035460c173fce Mon Sep 17 00:00:00 2001 From: rajan11 Date: Mon, 13 Nov 2023 02:29:49 -0600 Subject: [PATCH] Fix flaky test UtilTest.testEnhanceResponseWithShippingAddressList --- tst/com/amazon/pay/api/UtilTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tst/com/amazon/pay/api/UtilTest.java b/tst/com/amazon/pay/api/UtilTest.java index 2746e05..89391c2 100755 --- a/tst/com/amazon/pay/api/UtilTest.java +++ b/tst/com/amazon/pay/api/UtilTest.java @@ -254,7 +254,9 @@ public void testEnhanceResponseWithShippingAddressList() throws AmazonPayClientE expectedCheckoutSessionResponse.setResponse(expectedShippingAddressListResponse); expectedCheckoutSessionResponse.setRawResponse(expectedShippingAddressListResponse.toString()); - Assert.assertEquals(expectedCheckoutSessionResponse.getRawResponse(), actualCheckoutSessionResponseAfterEnhancing.getRawResponse()); + JSONObject expected = new JSONObject(expectedCheckoutSessionResponse.getRawResponse()); + JSONObject actual = new JSONObject(actualCheckoutSessionResponseAfterEnhancing.getRawResponse()); + Assert.assertTrue(expected.similar(actual)); } @Test