Package com.intuit.karate.core
Class MockHandler
- java.lang.Object
-
- com.intuit.karate.core.MockHandler
-
- All Implemented Interfaces:
ServerHandler
public class MockHandler extends Object implements ServerHandler
- Author:
- pthomas3
-
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<Request>LOCAL_REQUEST
-
Constructor Summary
Constructors Constructor Description MockHandler(Feature feature)MockHandler(Feature feature, Map<String,Object> args)MockHandler(String prefix, List<Feature> features, Map<String,Object> args)MockHandler(List<Feature> features)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptContains(String text)ObjectbodyPath(String path)Responsehandle(Request req)booleanheaderContains(String name, String value)booleanmethodIs(String name)booleanparamExists(String name)StringparamValue(String name)booleanpathMatches(String pattern)booleantypeContains(String text)
-
-
-
Field Detail
-
LOCAL_REQUEST
protected static final ThreadLocal<Request> LOCAL_REQUEST
-
-
Method Detail
-
handle
public Response handle(Request req)
- Specified by:
handlein interfaceServerHandler
-
pathMatches
public boolean pathMatches(String pattern)
-
paramExists
public boolean paramExists(String name)
-
methodIs
public boolean methodIs(String name)
-
typeContains
public boolean typeContains(String text)
-
acceptContains
public boolean acceptContains(String text)
-
-