Class DefaultResponseLocator
- java.lang.Object
-
- org.talend.sdk.component.junit.http.internal.impl.DefaultResponseLocator
-
- All Implemented Interfaces:
AutoCloseable
,ResponseLocator
public class DefaultResponseLocator extends Object implements ResponseLocator, AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultResponseLocator.Model
static class
DefaultResponseLocator.RequestModel
static class
DefaultResponseLocator.ResponseModel
-
Constructor Summary
Constructors Constructor Description DefaultResponseLocator(String prefix, String test)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModel(DefaultResponseLocator.Model model)
void
close()
protected boolean
doesHeadersMatch(Request request, DefaultResponseLocator.RequestModel model, Predicate<String> headerFilter)
protected Optional<Response>
doFind(Request request, String pref, ClassLoader loader, Predicate<String> headerFilter, boolean exactMatching)
Optional<Response>
findMatching(Request request, Predicate<String> headerFilter)
void
flush(String baseCapture)
protected byte[]
getPayload(DefaultResponseLocator.Model model)
protected boolean
matches(Request request, DefaultResponseLocator.RequestModel model, boolean exact, Predicate<String> headerFilter)
-
-
-
Field Detail
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultResponseLocator
public DefaultResponseLocator(String prefix, String test)
-
-
Method Detail
-
findMatching
public Optional<Response> findMatching(Request request, Predicate<String> headerFilter)
- Specified by:
findMatching
in interfaceResponseLocator
-
doFind
protected Optional<Response> doFind(Request request, String pref, ClassLoader loader, Predicate<String> headerFilter, boolean exactMatching)
-
getPayload
protected byte[] getPayload(DefaultResponseLocator.Model model)
-
matches
protected boolean matches(Request request, DefaultResponseLocator.RequestModel model, boolean exact, Predicate<String> headerFilter)
-
doesHeadersMatch
protected boolean doesHeadersMatch(Request request, DefaultResponseLocator.RequestModel model, Predicate<String> headerFilter)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
addModel
public void addModel(DefaultResponseLocator.Model model)
-
-