func TestJSONMockFail(t *testing.T) {
	t.Parallel()
	assert := assert.New(t)
	bad := unsupportedItem{
		Item: "hello",
	}
	_, err := mockserver.JSON(201, bad)
	assert.Error(err)
}
func TestNewMockJsonServer(t *testing.T) {
	t.Parallel()
	assert := assert.New(t)
	o := testItem{
		Item:  "testing",
		Count: 1234,
	}
	server, err := mockserver.JSON(201, o)
	assert.NoError(err)
	defer server.Close()
	resp, err := http.Get(server.URL + "/testing")
	assert.NoError(err)
	assert.Equal(201, resp.StatusCode)
	b, err := parseResp(resp.Body)
	assert.NoError(err)
	samp, err := json.Marshal(o)
	assert.NoError(err)
	assert.Equal(string(samp), b)
}