Beispiel #1
0
func runJSON(t crossdock.T, call call) {
	assert := crossdock.Assert(t)
	checks := crossdock.Checks(t)

	headers := map[string]string{
		"hello": "json",
	}
	token := random.String(5)

	resp, respHeaders, err := jsonCall(call, headers, token)
	if checks.NoError(err, "json: call failed") {
		assert.Equal(token, resp.Token, "body echoed")
		respHeaders = internal.RemoveVariableMapKeys(respHeaders)
		assert.Equal(headers, respHeaders, "headers echoed")
	}
}
Beispiel #2
0
func runThrift(t crossdock.T, call call) {
	assert := crossdock.Assert(t)
	checks := crossdock.Checks(t)

	headers := map[string]string{
		"hello": "thrift",
	}
	token := random.String(5)

	client := thrift.NewClient(call.Channel, serverName, &thrift.ClientOptions{HostPort: call.ServerHostPort})

	resp, respHeaders, err := thriftCall(client, headers, token)
	if checks.NoError(err, "thrift: call failed") {
		assert.Equal(token, resp.Boop, "body echoed")
		respHeaders = internal.RemoveVariableMapKeys(respHeaders)
		assert.Equal(headers, respHeaders, "headers echoed")
	}

	runGauntlet(t, client)
}