Skip to content

Commit

Permalink
Properly create OutputStream for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
purple4reina committed Jan 23, 2025
1 parent 7a8985b commit 23ba390
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ class LambdaHandlerTest extends DDCoreSpecification {
def "test moshi toJson OutputStream"() {
given:
def body = "{\"body\":\"bababango\",\"statusCode\":\"200\"}"
def myEvent = new ByteArrayOutputStream(body.getBytes())
def myEvent = new ByteArrayOutputStream()
myEvent.write(body.getBytes(), 0, body.length()

when:
def result = LambdaHandler.writeValueAsString(myEvent)
Expand Down

0 comments on commit 23ba390

Please sign in to comment.