From 38d3ca771f4ccec0894e3e472a03d3650389359b Mon Sep 17 00:00:00 2001 From: Simran Sandhu Date: Tue, 31 Oct 2023 21:00:37 -0500 Subject: [PATCH] Fix flaky test in CustomTypeAdaptersTest --- .../com/google/gson/functional/CustomTypeAdaptersTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java b/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java index d398e93677..7510f343cd 100644 --- a/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java +++ b/gson/src/test/java/com/google/gson/functional/CustomTypeAdaptersTest.java @@ -125,7 +125,8 @@ public void testCustomNestedSerializers() { } }).create(); ClassWithCustomTypeConverter target = new ClassWithCustomTypeConverter(); - assertThat(gson.toJson(target)).isEqualTo("{\"bag\":6,\"value\":10}"); + String targetStr = gson.toJson(target); + assertThat(targetStr.equals("{\"bag\":6,\"value\":10}") || targetStr.equals("{\"value\":10,\"bag\":6}")).isTrue(); } @Test