Changing a string to key:value pair to fix flakiness in `testSerializationWithDefaults` (#15317)

* + Fix for Flaky Test

* + Replacing TreeMap with LinkedHashMap

* + Changing data structure from LinkedHashMap to HashMap

* Fixed flaky test in S3DataSegmentPusherConfigTest.testSerializationValidatingMaxListingLength

* Minor Changes
This commit is contained in:
Krishna Anandan 2023-11-14 17:59:07 -06:00 committed by GitHub
parent 2cb74433fd
commit 06744d3827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -29,6 +29,7 @@ import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import java.io.IOException;
import java.util.Map;
import java.util.Set;
public class S3DataSegmentPusherConfigTest
@ -51,9 +52,10 @@ public class S3DataSegmentPusherConfigTest
String jsonConfig = "{\"bucket\":\"bucket1\",\"baseKey\":\"dataSource1\"}";
String expectedJsonConfig = "{\"bucket\":\"bucket1\",\"baseKey\":\"dataSource1\","
+ "\"disableAcl\":false,\"maxListingLength\":1024,\"useS3aSchema\":false}";
S3DataSegmentPusherConfig config = JSON_MAPPER.readValue(jsonConfig, S3DataSegmentPusherConfig.class);
Assert.assertEquals(expectedJsonConfig, JSON_MAPPER.writeValueAsString(config));
Map<String, String> expected = JSON_MAPPER.readValue(expectedJsonConfig, Map.class);
Map<String, String> actual = JSON_MAPPER.readValue(JSON_MAPPER.writeValueAsString(config), Map.class);
Assert.assertEquals(expected, actual);
}
@Test