Class FederatedCswMockServer
java.lang.Object
org.codice.ddf.itests.common.csw.mock.FederatedCswMockServer
Encompasses a Restito CSW Stub Server for use in integration testing. Handles handshake responses
and federated query responses for a csw endpoint.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFederatedCswMockServer(String sourceId, String httpRoot, int port) Constructor for the federated CSW Restito stub server. -
Method Summary
Modifier and TypeMethodDescriptionintgetPort()Get the port being used by the stub server.getRoot()Get the root url being used by the stub server.com.xebialabs.restito.server.StubServerReturns the restito stub server to allow for any unsupported actionsvoidreset()Resets the Restito server by stopping and starting it.voidSets the default response for theGetCapabilitiesrequest.voidvoidvoidsetupDefaultQueryResponseExpectation(String response) Sets the default response for theGetRecordsrequest.voidvoidstart()Starts the Restito stub server.voidstop()Stops the Restito stub server.com.xebialabs.restito.builder.verify.VerifyHttpReturns VerifyHttp's verifyHttp method with the stub server as the parameter.com.xebialabs.restito.builder.stub.StubHttpwhenHttp()Returns StubHttp's whenHttp method with the stub server as the parameter.
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
FederatedCswMockServer
Constructor for the federated CSW Restito stub server.- Parameters:
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.
-
-
Method Details
-
setupDefaultCapabilityResponseExpectation
Sets the default response for theGetCapabilitiesrequest. Will be used when this stub server is started and must be set beforestart()is called. If a different response is needed after startup, the normalwhenHttp()should be used instead of replacing this default response.- Parameters:
response- response to be returned
-
setupDefaultQueryResponseExpectation
Sets the default response for theGetRecordsrequest. Will be used when this stub server is started and must be set beforestart()is called. If a different response is needed after startup, the normalwhenHttp()should be used instead of replacing this default response.- Parameters:
response- response to be returned
-
setupDefaultInsertTransactionResponseExpectation
-
setupDefaultUpdateTransactionResponseExpectation
-
setupDefaultDeleteTransactionResponseExpectation
-
start
public void start()Starts the Restito stub server. -
stop
public void stop()Stops the Restito stub server. -
reset
public void reset()Resets the Restito server by stopping and starting it. -
whenHttp
public com.xebialabs.restito.builder.stub.StubHttp whenHttp()Returns StubHttp's whenHttp method with the stub server as the parameter. Use is the same. Sets up an Action when a specific Http call is made.- Returns:
- StubHttp using whenHttp method with the stub server as the parameter.
-
verifyHttp
public com.xebialabs.restito.builder.verify.VerifyHttp verifyHttp()Returns VerifyHttp's verifyHttp method with the stub server as the parameter. Use is the same. Provides itest verification when a specific Http call is made.- Returns:
- VerifyHttp using verifyHttp method with the stub server as the parameter.
-
getPort
public int getPort()Get the port being used by the stub server.- Returns:
- the port being used by the stub server.
-
getRoot
Get the root url being used by the stub server.- Returns:
- the root url being used by the stub server.
-
getServer
public com.xebialabs.restito.server.StubServer getServer()Returns the restito stub server to allow for any unsupported actions- Returns:
- the stub server managed by this class
-