spring-data-gemfire icon indicating copy to clipboard operation
spring-data-gemfire copied to clipboard

fix flaky test in JSONRegionAdviceIntegrationTests

Open CharlesZKQ opened this issue 4 years ago • 0 comments

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.

CharlesZKQ avatar Nov 21 '21 21:11 CharlesZKQ