org.mockserver.model
Class HttpError

java.lang.Object
  extended by org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
      extended by org.mockserver.model.ObjectWithJsonToString
          extended by org.mockserver.model.Action
              extended by org.mockserver.model.HttpError

public class HttpError
extends Action

Author:
jamesdbloom

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mockserver.model.Action
Action.Type
 
Field Summary
 
Fields inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
logger
 
Constructor Summary
HttpError()
           
 
Method Summary
 HttpError applyDelay()
           
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[]
 
Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toString
 
Methods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
addFieldsExcludedFromEqualsAndHashCode, equals, fieldsExcludedFromEqualsAndHashCode, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpError

public HttpError()
Method Detail

error

public static HttpError error()

withDropConnection

public HttpError withDropConnection(Boolean dropConnection)
Forces the connection to be dropped without any response being returned

Parameters:
dropConnection - if true the connection is drop without any response being returned

getDropConnection

public Boolean getDropConnection()

withResponseBytes

public HttpError withResponseBytes(byte[] responseBytes)
The raw response to be returned, allowing the expectation to specify any invalid response as a raw byte[]

Parameters:
responseBytes - the exact bytes that will be returned

getResponseBytes

public byte[] getResponseBytes()

withDelay

public HttpError withDelay(Delay delay)
The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)

Parameters:
delay - a Delay object, for example new Delay(TimeUnit.SECONDS, 3)

withDelay

public HttpError withDelay(TimeUnit timeUnit,
                           long value)
The delay before responding with this request as a Delay object, for example new Delay(TimeUnit.SECONDS, 3)

Parameters:
timeUnit - a the time unit, for example TimeUnit.SECONDS
value - a the number of time units to delay the response

getDelay

public Delay getDelay()

applyDelay

public HttpError applyDelay()

getType

public Action.Type getType()
Specified by:
getType in class Action


Copyright © 2017. All rights reserved.