Skip to content

Commit

Permalink
cdk-java: fix RecordDiffer
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-airbyte committed Jul 22, 2024
1 parent cb17e60 commit 08c8139
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import java.util.*
import java.util.function.Function
import java.util.stream.Collectors
import java.util.stream.IntStream
import java.util.stream.Stream
import kotlin.Array
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.function.Executable
Expand Down Expand Up @@ -366,11 +365,9 @@ constructor(
} else if (expectedValue is ObjectNode && actualValue is ObjectNode) {
// If both values are objects compare their fields and values
expectedValue.size() == actualValue.size() &&
Stream.generate { expectedValue.fieldNames().next() }
.limit(expectedValue.size().toLong())
.allMatch { field: String ->
areJsonNodesEquivalent(expectedValue[field], actualValue[field])
}
expectedValue.fieldNames().asSequence().all { field: String ->
areJsonNodesEquivalent(expectedValue[field], actualValue[field])
}
} else {
// Otherwise, we need to compare the actual values.
// This is kind of sketchy, but seems to work fine for the data we have in our test
Expand Down

0 comments on commit 08c8139

Please sign in to comment.