public class FederatedCswMockServer extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOGGER |
Constructor and Description |
---|
FederatedCswMockServer(String sourceId,
String httpRoot,
int port)
Constructor for the federated CSW Restito stub server.
|
Modifier and Type | Method and Description |
---|---|
int |
getPort()
Get the port being used by the stub server.
|
String |
getRoot()
Get the root url being used by the stub server.
|
com.xebialabs.restito.server.StubServer |
getServer()
Returns the restito stub server to allow for any unsupported actions
|
void |
reset()
Resets the Restito server by stopping and starting it.
|
void |
setupDefaultCapabilityResponseExpectation(String response)
Sets the default response for the
GetCapabilities request. |
void |
setupDefaultDeleteTransactionResponseExpectation(String response) |
void |
setupDefaultInsertTransactionResponseExpectation(String response) |
void |
setupDefaultQueryResponseExpectation(String response)
Sets the default response for the
GetRecords request. |
void |
setupDefaultUpdateTransactionResponseExpectation(String response) |
void |
start()
Starts the Restito stub server.
|
void |
stop()
Stops the Restito stub server.
|
com.xebialabs.restito.builder.verify.VerifyHttp |
verifyHttp()
Returns VerifyHttp's verifyHttp method with the stub server as the parameter.
|
com.xebialabs.restito.builder.stub.StubHttp |
whenHttp()
Returns StubHttp's whenHttp method with the stub server as the parameter.
|
public FederatedCswMockServer(String sourceId, String httpRoot, int port)
sourceId
- DDF sourceId to give to the stub server.httpRoot
- httpRoot address. Typically the non-secure root "http://localhost:".port
- Port number on which to respond.public void setupDefaultCapabilityResponseExpectation(String response)
GetCapabilities
request. Will be used when this stub
server is started and must be set before start()
is called. If a different response is
needed after startup, the normal whenHttp()
should be used instead of replacing this
default response.response
- response to be returnedpublic void setupDefaultQueryResponseExpectation(String response)
GetRecords
request. Will be used when this stub
server is started and must be set before start()
is called. If a different response is
needed after startup, the normal whenHttp()
should be used instead of replacing this
default response.response
- response to be returnedpublic void setupDefaultInsertTransactionResponseExpectation(String response)
public void setupDefaultUpdateTransactionResponseExpectation(String response)
public void setupDefaultDeleteTransactionResponseExpectation(String response)
public void start()
public void stop()
public void reset()
public com.xebialabs.restito.builder.stub.StubHttp whenHttp()
public com.xebialabs.restito.builder.verify.VerifyHttp verifyHttp()
public int getPort()
public String getRoot()
public com.xebialabs.restito.server.StubServer getServer()
This work is licensed under a Creative Commons Attribution 4.0 International License.