Skip to content

Commit

Permalink
add a test on payload size
Browse files Browse the repository at this point in the history
  • Loading branch information
vandonr committed Oct 18, 2023
1 parent 0f1a092 commit 969ff58
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class DefaultPathwayContextTest extends DDCoreSpecification {
assert point.parentHash == 0
assert point.pathwayLatencyNano == 0
assert point.edgeLatencyNano == 0
assert point.payloadSizeBytes == 0
}

def "First Set checkpoint starts the context."() {
Expand Down Expand Up @@ -79,6 +80,27 @@ class DefaultPathwayContextTest extends DDCoreSpecification {
}
}

def "Checkpoint with payload size"() {
given:
def timeSource = new ControllableTimeSource()
def context = new DefaultPathwayContext(timeSource, wellKnownTags)

when:
timeSource.advance(25)
context.setCheckpoint(
new LinkedHashMap<>(["group": "group", "topic": "topic", "type": "kafka"]), pointConsumer, 0, 72)

then:
context.isStarted()
pointConsumer.points.size() == 1
with(pointConsumer.points[0]) {
edgeTags == ["group:group", "topic:topic", "type:kafka"]
edgeTags.size() == 3
hash != 0
payloadSizeBytes == 72
}
}

def "Multiple checkpoints generated"() {
given:
def timeSource = new ControllableTimeSource()
Expand Down

0 comments on commit 969ff58

Please sign in to comment.