Package au.com.dius.pact.consumer
Class BaseMockServer
-
- All Implemented Interfaces:
-
au.com.dius.pact.consumer.MockServer
public abstract class BaseMockServer extends AbstractBaseMockServer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBaseMockServer.Companion
-
Field Summary
Fields Modifier and Type Field Description private final ConcurrentHashMap<IRequest, List<PactVerificationResult>>mismatchedRequestsprivate final ConcurrentLinkedQueue<Pair<IRequest, IRequest>>matchedRequestsprivate final BasePactpactprivate final MockProviderConfigconfigpublic final static BaseMockServer.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description BaseMockServer(BasePact pact, MockProviderConfig config)
-
Method Summary
Modifier and Type Method Description final ConcurrentHashMap<IRequest, List<PactVerificationResult>>getMismatchedRequests()final ConcurrentLinkedQueue<Pair<IRequest, IRequest>>getMatchedRequests()final BasePactgetPact()final MockProviderConfiggetConfig()UnitwaitForServer()<R extends Any> PactVerificationResultrunAndWritePact(BasePact pact, PactSpecVersion pactVersion, PactTestRun<R> testFn)This will start the mock server and execute the test function. final <R extends Any> PactVerificationResultverifyResultAndWritePact(R testResult, PactTestExecutionContext context, BasePact pact, PactSpecVersion pactVersion)PactVerificationResultvalidateMockServerState(Object testResult)Returns the results of validating the mock server state -
Methods inherited from class au.com.dius.pact.consumer.AbstractBaseMockServer
start, stop -
Methods inherited from class au.com.dius.pact.consumer.MockServer
getPort, getUrl, updatePact -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BaseMockServer
BaseMockServer(BasePact pact, MockProviderConfig config)
-
-
Method Detail
-
getMismatchedRequests
final ConcurrentHashMap<IRequest, List<PactVerificationResult>> getMismatchedRequests()
-
getMatchedRequests
final ConcurrentLinkedQueue<Pair<IRequest, IRequest>> getMatchedRequests()
-
getPact
final BasePact getPact()
-
getConfig
final MockProviderConfig getConfig()
-
waitForServer
Unit waitForServer()
-
runAndWritePact
<R extends Any> PactVerificationResult runAndWritePact(BasePact pact, PactSpecVersion pactVersion, PactTestRun<R> testFn)
This will start the mock server and execute the test function. Returns the result of running the test.
-
verifyResultAndWritePact
final <R extends Any> PactVerificationResult verifyResultAndWritePact(R testResult, PactTestExecutionContext context, BasePact pact, PactSpecVersion pactVersion)
-
validateMockServerState
PactVerificationResult validateMockServerState(Object testResult)
Returns the results of validating the mock server state
-
-
-
-