Esempio n. 1
0
func getFakeInteraction() *consumer.Interaction {
	header := make(http.Header)
	header.Add("content-type", "application/json")
	i := consumer.NewInteraction("description of the interaction",
		"some state",
		provider.NewProviderRequest("POST", "/", "param=xyzmk", header),
		provider.NewProviderResponse(201, header))

	i.Request.SetBody(`{ "firstName": "John", "lastName": "Doe" }`)
	i.Response.SetBody(`{"result": true}`)
	return i
}
Esempio n. 2
0
func (p *MockProviderService) registerInteraction() {
	interaction := consumer.NewInteraction(p.description, p.state, p.providerRequest, p.providerResponse)
	p.service.RegisterInteraction(interaction)
}