/** * Creates a new instance of {@link MessagePactBuilder} * * @param consumer */ private MessagePactBuilder(String consumer) { this.consumer = new Consumer(consumer); }
/** * The query string for the request * * @param query query string */ public PactDslRequestWithPath query(String query) { this.query = PactReaderKt.queryStringToMap(query, false); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithoutPath body(String body) { requestBody = OptionalBody.body(body); return this; }
/** * Adds a provider state to this interaction * @param state Description of the state */ public PactDslWithState given(String state) { addInteraction(); return new PactDslWithState(consumerPactBuilder, request.consumer.getName(), request.provider.getName(), new ProviderState(state), defaultRequestValues, defaultResponseValues); }
/** * Name the provider that the consumer has a pact with. * * @param provider provider name * @return this builder. */ public MessagePactBuilder hasPactWith(String provider) { this.provider = new Provider(provider); return this; }
private VerificationResult runPactTest(final Statement base, PactFragment pactFragment) { return pactFragment.runConsumer(config, new TestRun() { @Override public void run(MockProviderConfig config) throws Throwable { base.evaluate(); } }); }
/** * Adds a provider state to this interaction * @param state Description of the state */ public PactDslWithState given(String state) { addInteraction(); return new PactDslWithState(consumerPactBuilder, request.consumer.getName(), request.provider.getName(), new ProviderState(state), defaultRequestValues, defaultResponseValues); }
/** * Creates a new instance of {@link MessagePactBuilder} * * @param consumer */ private MessagePactBuilder(String consumer) { this.consumer = new Consumer(consumer); }
/** * Name the provider that the consumer has a pact with. * * @param provider provider name * @return this builder. */ public MessagePactBuilder hasPactWith(String provider) { this.provider = new Provider(provider); return this; }
/** * The query string for the request * * @param query query string */ public PactDslRequestWithPath query(String query) { this.query = PactReaderKt.queryStringToMap(query, false); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithPath body(String body) { requestBody = OptionalBody.body(body); return this; }
/** * Adds a provider state to this interaction * @param state Description of the state * @param params Data parameters for this state */ public PactDslWithState given(String state, Map<String, Object> params) { addInteraction(); return new PactDslWithState(consumerPactBuilder, request.consumer.getName(), request.provider.getName(), new ProviderState(state, params), defaultRequestValues, defaultResponseValues); }
/** * The encoded query string for the request * * @param query query string */ public PactDslRequestWithPath encodedQuery(String query) { this.query = PactReaderKt.queryStringToMap(query, true); return this; }
/** * Response body to return * * @param body Response body in string form */ public PactDslResponse body(String body) { this.responseBody = OptionalBody.body(body); return this; }
/** * The encoded query string for the request * * @param query query string */ public PactDslRequestWithPath encodedQuery(String query) { this.query = PactReaderKt.queryStringToMap(query, true); return this; }
/** * Response body to return * * @param body Response body in string form */ public PactDslResponse body(String body) { this.responseBody = OptionalBody.body(body); return this; }
/** * The query string for the request * * @param query query string */ public PactDslRequestWithoutPath query(String query) { this.query = PactReaderKt.queryStringToMap(query, false); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithPath body(String body) { requestBody = OptionalBody.body(body); return this; }
/** * The query string for the request * * @param query query string */ public PactDslRequestWithoutPath query(String query) { this.query = PactReaderKt.queryStringToMap(query, false); return this; }
/** * The body of the request * * @param body Request body in string form */ public PactDslRequestWithoutPath body(String body) { requestBody = OptionalBody.body(body); return this; }