Uses of Class
org.mockserver.mock.Expectation
-
-
Uses of Expectation in org.mockserver.client
Methods in org.mockserver.client that return Expectation Modifier and Type Method Description Expectation[]A2aMockBuilder. applyTo(MockServerClient client)Expectation[]LlmConversationBuilder. applyTo(MockServerClient client)Build all turn expectations and register them with the MockServerClient.Expectation[]LlmMockBuilder. applyTo(MockServerClient client)Build the expectation and register it with the MockServerClient.Expectation[]McpMockBuilder. applyTo(MockServerClient client)Expectation[]TurnBuilder. applyTo(MockServerClient client)Shortcut: build and register all turns with the MockServerClient.Expectation[]A2aMockBuilder. build()Expectation[]LlmConversationBuilder. build()Build all turn expectations without registering them.ExpectationLlmMockBuilder. build()Build the expectation without registering it.Expectation[]McpMockBuilder. build()Expectation[]ForwardChainExpectation. error(HttpError httpError)Return error when expectation is matchedExpectation[]ForwardChainExpectation. forward(ExpectationForwardCallback expectationForwardCallback)Call method on object locally or remotely (over web socket) to generate request to forward when expectation is matchedExpectation[]ForwardChainExpectation. forward(ExpectationForwardCallback expectationForwardCallback, ExpectationForwardAndResponseCallback expectationForwardResponseCallback)Call method on object locally or remotely (over web socket) to generate request to forward when expectation is matchedExpectation[]ForwardChainExpectation. forward(ExpectationForwardCallback expectationForwardCallback, ExpectationForwardAndResponseCallback expectationForwardResponseCallback, Delay delay)Call method on object locally or remotely (over web socket) to generate request to forward when expectation is matchedExpectation[]ForwardChainExpectation. forward(ExpectationForwardCallback expectationForwardCallback, Delay delay)Call method on object locally or remotely (over web socket) to generate request to forward when expectation is matchedExpectation[]ForwardChainExpectation. forward(HttpClassCallback httpClassCallback)Call method on local class in same JVM implementing ExpectationResponseCallback to generate request to forward when expectation is matchedExpectation[]ForwardChainExpectation. forward(HttpForward httpForward)Forward request to the specified host and port when expectation is matchedExpectation[]ForwardChainExpectation. forward(HttpOverrideForwardedRequest httpOverrideForwardedRequest)Override fields, headers, and cookies etc in request being forwarded with specified fields, headers and cookies, etc in the specified request when expectation is matchedExpectation[]ForwardChainExpectation. forward(HttpTemplate httpTemplate)Evaluate Velocity or JavaScript template to generate request to forward when expectation is matchedExpectation[]ForwardChainExpectation. respond(List<HttpResponse> httpResponses)Set a list of responses to cycle through sequentially when expectation is matched.Expectation[]ForwardChainExpectation. respond(ExpectationResponseCallback expectationResponseCallback)Call method on object locally or remotely (over web socket) to generate response to return when expectation is matchedExpectation[]ForwardChainExpectation. respond(ExpectationResponseCallback expectationResponseCallback, Delay delay)Call method on object locally or remotely (over web socket) to generate response to return when expectation is matchedExpectation[]ForwardChainExpectation. respond(HttpClassCallback httpClassCallback)Call method on local class in same JVM implementing ExpectationResponseCallback to generate response to return when expectation is matchedExpectation[]ForwardChainExpectation. respond(HttpResponse httpResponse)Return response when expectation is matchedExpectation[]ForwardChainExpectation. respond(HttpTemplate httpTemplate)Evaluate Velocity or JavaScript template to generate response to return when expectation is matchedExpectation[]ForwardChainExpectation. respondWithBinary(BinaryResponse binaryResponse)Expectation[]ForwardChainExpectation. respondWithDns(DnsResponse dnsResponse)Expectation[]ForwardChainExpectation. respondWithGrpcStream(GrpcStreamResponse grpcStreamResponse)Expectation[]ForwardChainExpectation. respondWithLlm(HttpLlmResponse httpLlmResponse)Expectation[]ForwardChainExpectation. respondWithSse(HttpSseResponse httpSseResponse)Expectation[]ForwardChainExpectation. respondWithWebSocket(HttpWebSocketResponse httpWebSocketResponse)Expectation[]MockServerClient. retrieveActiveExpectations(RequestDefinition requestDefinition)Retrieve the active expectations match the httpRequest parameter, use null for the parameter to retrieve all expectationsExpectation[]MockServerClient. retrieveRecordedExpectations(RequestDefinition requestDefinition)Retrieve the request-response combinations that have been recorded as a list of expectations, only those that match the httpRequest parameter are returned, use null to retrieve all requestsExpectation[]MockServerClient. sendExpectation(Expectation... expectations)Deprecated.this is deprecated due to unclear naming, use method upsert(Expectation... expectations) insteadExpectation[]MockServerClient. upsert(Expectation... expectations)Specify one or more expectations to be create, or updated (if the id matches).Expectation[]MockServerClient. upsert(OpenAPIExpectation... openAPIExpectations)Specify OpenAPI and operations and responses to create matchers and example responsesMethods in org.mockserver.client with parameters of type Expectation Modifier and Type Method Description Expectation[]MockServerClient. sendExpectation(Expectation... expectations)Deprecated.this is deprecated due to unclear naming, use method upsert(Expectation... expectations) insteadExpectation[]MockServerClient. upsert(Expectation... expectations)Specify one or more expectations to be create, or updated (if the id matches). -
Uses of Expectation in org.mockserver.codec
Constructors in org.mockserver.codec with parameters of type Expectation Constructor Description JsonSchemaBodyDecoder(Configuration configuration, MockServerLogger mockServerLogger, Expectation expectation, HttpRequest httpRequest) -
Uses of Expectation in org.mockserver.examples.mockserver.initializer
Methods in org.mockserver.examples.mockserver.initializer that return Expectation Modifier and Type Method Description Expectation[]ExpectationInitializerExample. initializeExpectations() -
Uses of Expectation in org.mockserver.fixture
Methods in org.mockserver.fixture that return Expectation Modifier and Type Method Description Expectation[]SseAwareExpectationConverter. convert(Expectation[] expectations)Convert an array of expectations, making streaming responses SSE-aware.Expectation[]FixtureRedactor. redact(Expectation[] expectations)Redact sensitive headers in an array of expectations.Methods in org.mockserver.fixture with parameters of type Expectation Modifier and Type Method Description Expectation[]SseAwareExpectationConverter. convert(Expectation[] expectations)Convert an array of expectations, making streaming responses SSE-aware.Expectation[]FixtureRedactor. redact(Expectation[] expectations)Redact sensitive headers in an array of expectations. -
Uses of Expectation in org.mockserver.lifecycle
Method parameters in org.mockserver.lifecycle with type arguments of type Expectation Modifier and Type Method Description voidExpectationsListener. updated(List<Expectation> expectations) -
Uses of Expectation in org.mockserver.log
Method parameters in org.mockserver.log with type arguments of type Expectation Modifier and Type Method Description voidMockServerEventLog. retrieveRecordedExpectations(RequestDefinition requestDefinition, Consumer<List<Expectation>> listConsumer) -
Uses of Expectation in org.mockserver.log.model
Methods in org.mockserver.log.model that return Expectation Modifier and Type Method Description ExpectationExpectationLogEntry. getExpectation()ExpectationLogEntry. getExpectation()Methods in org.mockserver.log.model with parameters of type Expectation Modifier and Type Method Description LogEntryLogEntry. setExpectation(Expectation expectation) -
Uses of Expectation in org.mockserver.matchers
Fields in org.mockserver.matchers declared as Expectation Modifier and Type Field Description protected ExpectationAbstractHttpRequestMatcher. expectationMethods in org.mockserver.matchers that return Expectation Modifier and Type Method Description ExpectationAbstractHttpRequestMatcher. getExpectation()ExpectationHttpRequestMatcher. getExpectation()Methods in org.mockserver.matchers with parameters of type Expectation Modifier and Type Method Description HttpRequestMatcherMatcherBuilder. transformsToMatcher(Expectation expectation)booleanAbstractHttpRequestMatcher. update(Expectation expectation)booleanHttpRequestMatcher. update(Expectation expectation) -
Uses of Expectation in org.mockserver.mock
Methods in org.mockserver.mock that return Expectation Modifier and Type Method Description ExpectationRequestMatchers. add(Expectation expectation, MockServerMatcherNotifier.Cause cause)ExpectationExpectation. clone()ExpectationHttpState. firstMatchingEarlyExpectation(HttpRequest headersOnly)Returns the first expectation whose matcher has respondBeforeBody=true, has no body matcher, and matches the supplied headers-only request.ExpectationRequestMatchers. firstMatchingEarlyExpectation(HttpRequest headersOnlyRequest)ExpectationHttpState. firstMatchingExpectation(RequestDefinition request)ExpectationRequestMatchers. firstMatchingExpectation(RequestDefinition requestDefinition)ExpectationExpectation. thenError(HttpError httpError)ExpectationExpectation. thenForward(HttpClassCallback httpClassCallback)ExpectationExpectation. thenForward(HttpForward httpForward)ExpectationExpectation. thenForward(HttpObjectCallback httpObjectCallback)ExpectationExpectation. thenForward(HttpOverrideForwardedRequest httpOverrideForwardedRequest)ExpectationExpectation. thenForward(HttpTemplate httpTemplate)ExpectationExpectation. thenForwardValidate(HttpForwardValidateAction httpForwardValidateAction)ExpectationExpectation. thenRespond(List<HttpResponse> httpResponses)ExpectationExpectation. thenRespond(HttpClassCallback httpClassCallback)ExpectationExpectation. thenRespond(HttpObjectCallback httpObjectCallback)ExpectationExpectation. thenRespond(HttpResponse httpResponse)ExpectationExpectation. thenRespond(HttpTemplate httpTemplate)ExpectationExpectation. thenRespondWithBinary(BinaryResponse binaryResponse)ExpectationExpectation. thenRespondWithDns(DnsResponse dnsResponse)ExpectationExpectation. thenRespondWithGrpcStream(GrpcStreamResponse grpcStreamResponse)ExpectationExpectation. thenRespondWithLlm(HttpLlmResponse httpLlmResponse)ExpectationExpectation. thenRespondWithSse(HttpSseResponse httpSseResponse)ExpectationExpectation. thenRespondWithWebSocket(HttpWebSocketResponse httpWebSocketResponse)static ExpectationExpectation. when(String specUrlOrPayload, String operationId)Specify the OpenAPI and operationId to match against by URL or payload and string as follows:static ExpectationExpectation. when(String specUrlOrPayload, String operationId, int priority)Specify the OpenAPI and operationId to match against by URL or payload and string with a match priority as follows:static ExpectationExpectation. when(String specUrlOrPayload, String operationId, Times times, TimeToLive timeToLive)Specify the OpenAPI and operationId to match against by URL or payload and string for a limit number of times or time as follows:static ExpectationExpectation. when(String specUrlOrPayload, String operationId, Times times, TimeToLive timeToLive, int priority)Specify the OpenAPI and operationId to match against by URL or payload and string for a limit number of times or time and a match priority as follows:static ExpectationExpectation. when(HttpRequest httpRequest)Specify the HttpRequest to match against as follows:static ExpectationExpectation. when(HttpRequest httpRequest, int priority)Specify the HttpRequest to match against with a match priority as follows:static ExpectationExpectation. when(HttpRequest httpRequest, Times times, TimeToLive timeToLive)Specify the HttpRequest to match against for a limit number of times or time as follows:static ExpectationExpectation. when(HttpRequest httpRequest, Times times, TimeToLive timeToLive, int priority)Specify the HttpRequest to match against for a limit number of times or time and a match priority as follows:ExpectationExpectation. withAfterActions(List<AfterAction> afterActions)ExpectationExpectation. withAfterActions(AfterAction... afterActions)ExpectationExpectation. withCreated(long created)ExpectationExpectation. withId(String id)Set id of this expectation which can be used to update this expectation later or for clearing or verifying by expectation id.ExpectationExpectation. withIdIfNull(String id)ExpectationExpectation. withNewScenarioState(String newScenarioState)ExpectationExpectation. withPercentage(Integer percentage)ExpectationExpectation. withPriority(int priority)Set priority of this expectation which is used to determine the matching order of expectations when a request is received.ExpectationExpectation. withResponseMode(ResponseMode responseMode)ExpectationExpectation. withScenarioName(String scenarioName)ExpectationExpectation. withScenarioState(String scenarioState)Methods in org.mockserver.mock that return types with arguments of type Expectation Modifier and Type Method Description List<Expectation>HttpState. add(Expectation... expectations)List<Expectation>HttpState. add(OpenAPIExpectation openAPIExpectation)List<Expectation>HttpState. allMatchingExpectation(HttpRequest request)List<Expectation>RequestMatchers. retrieveActiveExpectations(RequestDefinition requestDefinition)Methods in org.mockserver.mock with parameters of type Expectation Modifier and Type Method Description List<Expectation>HttpState. add(Expectation... expectations)ExpectationRequestMatchers. add(Expectation expectation, MockServerMatcherNotifier.Cause cause)voidHttpState. postProcess(Expectation expectation)voidRequestMatchers. update(Expectation[] expectations, MockServerMatcherNotifier.Cause cause) -
Uses of Expectation in org.mockserver.mock.action.http
Methods in org.mockserver.mock.action.http with parameters of type Expectation Modifier and Type Method Description voidHttpActionHandler. processEarlyAction(HttpRequest request, Expectation expectation, io.netty.channel.ChannelHandlerContext ctx, ResponseWriter earlyResponseWriter, boolean synchronous)Dispatch an early-matched expectation before the request body has been received. -
Uses of Expectation in org.mockserver.openapi
Methods in org.mockserver.openapi that return types with arguments of type Expectation Modifier and Type Method Description List<Expectation>OpenAPIConverter. buildExpectations(String specUrlOrPayload, Map<String,Object> operationsAndResponses)List<Expectation>OpenAPIConverter. buildExpectations(String specUrlOrPayload, Map<String,Object> operationsAndResponses, String contextPathPrefix) -
Uses of Expectation in org.mockserver.persistence
Methods in org.mockserver.persistence with parameters of type Expectation Modifier and Type Method Description StringExpectationFileSystemPersistence. serialize(Expectation... expectations)StringRecordedExpectationFileSystemPersistence. serialize(Expectation... expectations)Method parameters in org.mockserver.persistence with type arguments of type Expectation Modifier and Type Method Description StringExpectationFileSystemPersistence. serialize(List<Expectation> expectations)StringRecordedExpectationFileSystemPersistence. serialize(List<Expectation> expectations) -
Uses of Expectation in org.mockserver.serialization
Methods in org.mockserver.serialization that return Expectation Modifier and Type Method Description ExpectationExpectationSerializer. deserialize(String jsonExpectation)Expectation[]ExpectationSerializer. deserializeArray(String jsonExpectations, boolean allowEmpty)Expectation[]ExpectationSerializer. deserializeArray(String jsonExpectations, boolean allowEmpty, BiFunction<String,List<Expectation>,List<Expectation>> expectationModifier)Methods in org.mockserver.serialization that return types with arguments of type Expectation Modifier and Type Method Description List<Expectation>OpenAPIExpectationSerializer. deserializeToExpectations(String jsonOpenAPIExpectation)Class<Expectation>ExpectationSerializer. supportsType()Methods in org.mockserver.serialization with parameters of type Expectation Modifier and Type Method Description StringExpectationSerializer. serialize(Expectation expectation)StringExpectationSerializer. serialize(Expectation... expectations)Method parameters in org.mockserver.serialization with type arguments of type Expectation Modifier and Type Method Description Expectation[]ExpectationSerializer. deserializeArray(String jsonExpectations, boolean allowEmpty, BiFunction<String,List<Expectation>,List<Expectation>> expectationModifier)Expectation[]ExpectationSerializer. deserializeArray(String jsonExpectations, boolean allowEmpty, BiFunction<String,List<Expectation>,List<Expectation>> expectationModifier)StringExpectationSerializer. serialize(List<Expectation> expectations)byte[]ExpectationExportSerializer. serializeAsBrunoCollection(List<Expectation> expectations)StringExpectationExportSerializer. serializeAsOpenApi(List<Expectation> expectations)StringExpectationExportSerializer. serializeAsPostmanCollection(List<Expectation> expectations) -
Uses of Expectation in org.mockserver.serialization.java
Methods in org.mockserver.serialization.java with parameters of type Expectation Modifier and Type Method Description StringExpectationToJavaSerializer. serialize(int numberOfSpacesToIndent, Expectation expectation)Method parameters in org.mockserver.serialization.java with type arguments of type Expectation Modifier and Type Method Description StringExpectationToJavaSerializer. serialize(List<Expectation> expectations) -
Uses of Expectation in org.mockserver.serialization.model
Methods in org.mockserver.serialization.model that return Expectation Modifier and Type Method Description ExpectationExpectationDTO. buildObject()Constructors in org.mockserver.serialization.model with parameters of type Expectation Constructor Description ExpectationDTO(Expectation expectation) -
Uses of Expectation in org.mockserver.server.initialize
Methods in org.mockserver.server.initialize that return Expectation Modifier and Type Method Description Expectation[]ExpectationInitializer. initializeExpectations()Expectation[]ExpectationInitializerLoader. loadExpectations()Methods in org.mockserver.server.initialize that return types with arguments of type Expectation Modifier and Type Method Description List<Expectation>ExpectationInitializerLoader. retrieveExpectationsFromFile(String initialLogMessage, String expectationLogMessage, String completedLogMessage, MockServerMatcherNotifier.Cause.Type causeType)List<Expectation>ExpectationInitializerLoader. retrieveExpectationsFromOpenAPIFile(String initialLogMessage, String exceptionLogMessage, String completedLogMessage, MockServerMatcherNotifier.Cause.Type causeType)
-