public static final class FnTestingRule.TestOutput extends Object implements FnResult
| Modifier and Type | Method and Description |
|---|---|
static FnTestingRule.TestOutput |
fromOutputEvent(com.fnproject.fn.api.OutputEvent from)
construct a test output from an output event - this consums the body of the output event
|
byte[] |
getBodyAsBytes() |
String |
getBodyAsString()
Returns the buffered body of the event as a string
|
Optional<String> |
getContentType() |
com.fnproject.fn.api.Headers |
getHeaders() |
com.fnproject.fn.api.OutputEvent.Status |
getStatus() |
void |
writeToOutput(OutputStream out) |
public static FnTestingRule.TestOutput fromOutputEvent(com.fnproject.fn.api.OutputEvent from) throws IOException
from - an output event to consumeIOExceptionpublic com.fnproject.fn.api.OutputEvent.Status getStatus()
getStatus in interface com.fnproject.fn.api.OutputEventpublic Optional<String> getContentType()
getContentType in interface com.fnproject.fn.api.OutputEventpublic com.fnproject.fn.api.Headers getHeaders()
getHeaders in interface com.fnproject.fn.api.OutputEventpublic void writeToOutput(OutputStream out) throws IOException
writeToOutput in interface com.fnproject.fn.api.OutputEventIOExceptionpublic byte[] getBodyAsBytes()
getBodyAsBytes in interface FnResultpublic String getBodyAsString()
getBodyAsString in interface FnResultCopyright © 2021. All rights reserved.