spring-data-gemfire
spring-data-gemfire copied to clipboard
fix flaky test in JSONRegionAdviceIntegrationTests
In org.springframework.data.gemfire.serialization.json.JSONRegionAdviceIntegrationTests, the tests objectToJSon() , templateFind(), templateFindUnique(), templateQuery() are all flaky due to the non-deterministic property of getDeclatedFields() (please refer document), which is used in serialization of org.apache.geode.cache.Region and com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(). I fixed it by adding @JsonPropertyOrder annotation to fix fix its order of properties during serialization of putting into Region, and adding MapperFeature.SORT_PROPERTIES_ALPHABETICALLY to make the mapper in alphabetical order.