Esempio n. 1
0
func newNetworkClient(config Config) network.Client {
	return network.NewClient(network.Config{
		Host:          config.Host,
		SkipVerifySSL: config.SkipVerifySSL,
		TraceWriter:   config.TraceWriter,
	})
}
Esempio n. 2
0
			}
			responseBody.Body = string(requestBody)
			responseBody.Headers = req.Header

			response, err := json.Marshal(responseBody)
			if err != nil {
				panic(err)
			}

			w.WriteHeader(http.StatusOK)
			w.Write(response)
		}))

		client = network.NewClient(network.Config{
			Host:          fakeServer.URL,
			SkipVerifySSL: true,
			TraceWriter:   TraceWriter,
		})
	})

	AfterEach(func() {
		fakeServer.Close()
	})

	Describe("makeRequest", func() {
		It("can make requests", func() {
			jsonBody := map[string]interface{}{
				"hello": "goodbye",
			}

			resp, err := client.MakeRequest(network.Request{