Skip to content

Commit 0f19c84

Browse files
author
Grace Calianese
committed
style
1 parent 385f654 commit 0f19c84

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

json/src/main/java/com/basistech/rosette/apimodel/jackson/recordsimilaritydeserializers/RecordSimilarityDeserializerUtilities.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ static Map<String, RecordSimilarityField> parseRecordForResponse(JsonNode jsonNo
7171
jsonNode.fields().forEachRemaining(entry -> {
7272
String fieldName = entry.getKey();
7373
try {
74-
recordMap.put(fieldName, jsonNode.get(fieldName).traverse(jsonParser.getCodec()).readValueAs(UnknownField.class));
74+
recordMap.put(fieldName, jsonNode.get(fieldName).traverse(jsonParser.getCodec())
75+
.readValueAs(UnknownField.class));
7576
} catch (IOException e) {
7677
throw new RuntimeException(e);
7778
}

json/src/test/java/com/basistech/rosette/apimodel/recordsimilarity/RecordSimilarityResponseTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public void testDeserialization() throws JsonProcessingException {
120120
MAPPER.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY);
121121
MAPPER.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS);
122122
final RecordSimilarityResponse response = MAPPER.readValue(EXPECTED_JSON, RecordSimilarityResponse.class);
123+
//Can't compare response objects directly since fields within names and other RecordSimilarityField may
124+
// change order, so compare the content of their json strings with fields sorted alphabetically
123125
assertEquals(MAPPER.writeValueAsString(response), MAPPER.writeValueAsString(EXPECTED_RESPONSE));
124126
}
125127

0 commit comments

Comments
 (0)