/** * Adds another provider state to this interaction * @param stateDesc Description of the state */ public PactDslWithState given(String stateDesc) { state.add(new ProviderState(stateDesc)); return this; }
/** * Adds another provider state to this interaction * @param stateDesc Description of the state * @param params State data parameters */ public PactDslWithState given(String stateDesc, Map<String, Object> params) { state.add(new ProviderState(stateDesc, params)); return this; } }
/** * Adds another provider state to this interaction * @param stateDesc Description of the state * @param params State data parameters */ public PactDslWithState given(String stateDesc, Map<String, Object> params) { state.add(new ProviderState(stateDesc, params)); return this; } }
/** * Sets the provider state. * * @param providerState state of the provider * @return this builder. */ public MessagePactBuilder given(String providerState) { this.providerStates.add(new ProviderState(providerState)); return this; }
/** * Adds another provider state to this interaction * @param stateDesc Description of the state */ public PactDslWithState given(String stateDesc) { state.add(new ProviderState(stateDesc)); return this; }
/** * Sets the provider state. * * @param providerState state of the provider * @return this builder. */ public MessagePactBuilder given(String providerState) { this.providerStates.add(new ProviderState(providerState)); return this; }
/** * Describe the state the provider needs to be in for the pact test to be verified. * * @param state Provider state */ public PactDslWithState given(String state) { return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName, new ProviderState(state), defaultRequestValues, defaultResponseValues); }
/** * Describe the state the provider needs to be in for the pact test to be verified. * * @param state Provider state */ public PactDslWithState given(String state) { return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName, new ProviderState(state), defaultRequestValues, defaultResponseValues); }
/** * Describe the state the provider needs to be in for the pact test to be verified. * * @param state Provider state * @param params Data parameters for the state */ public PactDslWithState given(String state, Map<String, Object> params) { return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName, new ProviderState(state, params), defaultRequestValues, defaultResponseValues); }
/** * Describe the state the provider needs to be in for the pact test to be verified. * * @param state Provider state * @param params Data parameters for the state */ public PactDslWithState given(String state, Map<String, Object> params) { return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName, new ProviderState(state, params), defaultRequestValues, defaultResponseValues); }
/** * Describe the state the provider needs to be in for the pact test to be verified. * * @param firstKey Key of first parameter element * @param firstValue Value of first parameter element * @param paramsKeyValuePair Additional parameters in key-value pairs */ public PactDslWithState given(String state, String firstKey, Object firstValue, Object... paramsKeyValuePair) { if (paramsKeyValuePair.length % 2 != 0) { throw new IllegalArgumentException("Pair key value should be provided, but there is one key without value."); } final Map<String, Object> params = new HashMap<>(); params.put(firstKey, firstValue); for (int i = 0; i < paramsKeyValuePair.length; i+=2) { params.put(paramsKeyValuePair[i].toString(), paramsKeyValuePair[i+1]); } return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName, new ProviderState(state, params), defaultRequestValues, defaultResponseValues); }
/** * Describe the state the provider needs to be in for the pact test to be verified. * * @param firstKey Key of first parameter element * @param firstValue Value of first parameter element * @param paramsKeyValuePair Additional parameters in key-value pairs */ public PactDslWithState given(String state, String firstKey, Object firstValue, Object... paramsKeyValuePair) { if (paramsKeyValuePair.length % 2 != 0) { throw new IllegalArgumentException("Pair key value should be provided, but there is one key without value."); } final Map<String, Object> params = new HashMap<>(); params.put(firstKey, firstValue); for (int i = 0; i < paramsKeyValuePair.length; i+=2) { params.put(paramsKeyValuePair[i].toString(), paramsKeyValuePair[i+1]); } return new PactDslWithState(consumerPactBuilder, consumerPactBuilder.getConsumerName(), providerName, new ProviderState(state, params), defaultRequestValues, defaultResponseValues); }
/** * 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); } }
/** * 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); }
/** * 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); }
/** * 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); }