Skip to content

Commit

Permalink
feat(openapi): Enhance batch processing operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Nov 17, 2024
1 parent bba6bca commit 2b2cf2e
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ class BatchResultsKtTest {

@Test
fun toBatchResultWhenError() {
// Arrange
val flux = Flux.error<AggregateId>(RuntimeException("error"))
val flux = Flux.create<AggregateId> { sink ->
sink.next(MOCK_AGGREGATE_METADATA.aggregateId("id1"))
sink.error(RuntimeException("error"))
sink.next(MOCK_AGGREGATE_METADATA.aggregateId("id2"))
}
val afterId = "id0"

// Act
flux.toBatchResult(afterId)
.test()
.expectNext(BatchResult(afterId, 0, ErrorCodes.BAD_REQUEST, "error"))
.expectNext(BatchResult("id1", 1, ErrorCodes.BAD_REQUEST, "error"))
.verifyComplete()
}
}

0 comments on commit 2b2cf2e

Please sign in to comment.