@ThreadSafe
public interface TestPlan
A test plan provides the following functions:
HttpSpy from the
system under test
Concurrency notes. Test plan instance can be accessed from multiple
threads serving requests inside HttpSpy. All servicing threads invoke
getResponse(com.github.tashoyan.httpspy.HttpRequest). Finally, the main test thread invokes verify().
Therefore, thread safety requirements are:
getResponse(com.github.tashoyan.httpspy.HttpRequest) provides a safe way to concurrently get
responses from many threads.
verify() may have no special mechanism to ensure thread
safety. However it should be invoked only after (be means of happens-before
relationship) all servicing threads are done their job.
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
getResponse(HttpRequest actualRequest)
Gets a response for an actual request.
|
boolean |
isMultithreaded()
Checks if this test plan supports multiple service threads.
|
void |
verify()
Verifies actual requests against request expectations.
|
HttpResponse getResponse(HttpRequest actualRequest)
actualRequest - A request that has been received from the system
under test.NullPointerException - actualRequest is null.void verify()
AssertionError - Actual requests do not match request expectations.boolean isMultithreaded()
true if multiple service threads can work with this test
plan.Copyright © 2016. All rights reserved.