Skip to content

Commit 37a9221

Browse files
authored
Remove PolarisTestMetaStoreManager.jsonNode helper (apache#2513)
1 parent b8d210a commit 37a9221

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

polaris-core/src/testFixtures/java/org/apache/polaris/core/persistence/PolarisTestMetaStoreManager.java

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
*/
1919
package org.apache.polaris.core.persistence;
2020

21-
import com.fasterxml.jackson.core.JsonProcessingException;
22-
import com.fasterxml.jackson.databind.JsonNode;
23-
import com.fasterxml.jackson.databind.ObjectMapper;
2421
import jakarta.annotation.Nonnull;
2522
import java.util.ArrayList;
2623
import java.util.HashSet;
@@ -69,7 +66,6 @@ public class PolarisTestMetaStoreManager {
6966

7067
// the start time
7168
private final long testStartTime;
72-
private final ObjectMapper objectMapper = new ObjectMapper();
7369

7470
private final boolean supportsChangeTracking;
7571

@@ -1515,14 +1511,14 @@ public PolarisBaseEntity updateEntity(
15151511
Assertions.assertThat(afterUpdateEntity.getGrantRecordsVersion()).isEqualTo(grantRecsVersion);
15161512

15171513
// update should have been performed
1518-
Assertions.assertThat(jsonNode(updatedEntity.getProperties()))
1519-
.isEqualTo(jsonNode(updatedPropEntity.getProperties()));
1520-
Assertions.assertThat(jsonNode(afterUpdateEntity.getProperties()))
1521-
.isEqualTo(jsonNode(updatedPropEntity.getProperties()));
1522-
Assertions.assertThat(jsonNode(updatedEntity.getInternalProperties()))
1523-
.isEqualTo(jsonNode(updatedPropEntity.getInternalProperties()));
1524-
Assertions.assertThat(jsonNode(afterUpdateEntity.getInternalProperties()))
1525-
.isEqualTo(jsonNode(updatedPropEntity.getInternalProperties()));
1514+
Assertions.assertThat(updatedEntity.getPropertiesAsMap())
1515+
.isEqualTo(updatedPropEntity.getPropertiesAsMap());
1516+
Assertions.assertThat(afterUpdateEntity.getPropertiesAsMap())
1517+
.isEqualTo(updatedPropEntity.getPropertiesAsMap());
1518+
Assertions.assertThat(updatedEntity.getInternalPropertiesAsMap())
1519+
.isEqualTo(updatedPropEntity.getInternalPropertiesAsMap());
1520+
Assertions.assertThat(afterUpdateEntity.getInternalPropertiesAsMap())
1521+
.isEqualTo(updatedPropEntity.getInternalPropertiesAsMap());
15261522

15271523
// lookup the tracking slice to verify this has been updated too
15281524
if (supportsChangeTracking) {
@@ -1542,17 +1538,6 @@ public PolarisBaseEntity updateEntity(
15421538
return updatedEntity;
15431539
}
15441540

1545-
private JsonNode jsonNode(String json) {
1546-
if (json == null) {
1547-
return null;
1548-
}
1549-
try {
1550-
return objectMapper.readTree(json);
1551-
} catch (JsonProcessingException e) {
1552-
throw new RuntimeException(e);
1553-
}
1554-
}
1555-
15561541
/** Execute a list operation and validate the result */
15571542
private void validateListReturn(
15581543
List<PolarisEntityCore> path,

0 commit comments

Comments
 (0)