public class HttpError extends Action
Action.Type
Constructor and Description |
---|
HttpError() |
Modifier and Type | Method and Description |
---|---|
static HttpError |
error() |
Delay |
getDelay() |
Boolean |
getDropConnection() |
byte[] |
getResponseBytes() |
Action.Type |
getType() |
HttpError |
withDelay(Delay delay)
The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)
|
HttpError |
withDelay(TimeUnit timeUnit,
long value)
The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)
|
HttpError |
withDropConnection(Boolean dropConnection)
Forces the connection to be dropped without any response being returned
|
HttpError |
withResponseBytes(byte[] responseBytes)
The raw response to be returned, allowing the expectation to specify any invalid response as a raw byte[]
|
toString
equals, fieldsExcludedFromEqualsAndHashCode, hashCode, key
public static HttpError error()
public HttpError withDropConnection(Boolean dropConnection)
dropConnection
- if true the connection is drop without any response being returnedpublic Boolean getDropConnection()
public HttpError withResponseBytes(byte[] responseBytes)
responseBytes
- the exact bytes that will be returnedpublic byte[] getResponseBytes()
public HttpError withDelay(Delay delay)
delay
- a Delay object, for example new Delay(TimeUnit.SECONDS, 3)public HttpError withDelay(TimeUnit timeUnit, long value)
timeUnit
- a the time unit, for example TimeUnit.SECONDSvalue
- a the number of time units to delay the responsepublic Delay getDelay()
public Action.Type getType()
Copyright © 2018. All rights reserved.