func TestParseWithPartialRequest(t *testing.T) {
	res := dh.RequestResource{}

	jsonString := `{ "url": "http://example.com/some/resource" }`
	incomingJson := strings.NewReader(jsonString)

	expectedIncoming := api.IncomingRequest{URL: "http://example.com/some/resource"}

	r, _ := res.DecodeInputRequest(incomingJson)
	if *r != expectedIncoming {
		t.Errorf(`DecodeInputRequest('%s') = %q want %q`, jsonString, r, expectedIncoming)
	}
}
func TestParseCompleteRequest(t *testing.T) {
	res := dh.RequestResource{}

	jsonString := `{ "url": "http://example.com/some/resource", "checksum": "abcde", "checksum_type": "abc", "callback": "http://example.com/callback" }`
	incomingJson := strings.NewReader(jsonString)

	expectedIncoming := api.IncomingRequest{
		URL:          "http://example.com/some/resource",
		Checksum:     "abcde",
		ChecksumType: "abc",
		Callback:     "http://example.com/callback"}

	r, _ := res.DecodeInputRequest(incomingJson)
	if *r != expectedIncoming {
		t.Errorf(`DecodeInputRequest('%s') = %q want %q`, jsonString, r, expectedIncoming)
	}
}
func TestGetRequestURL(t *testing.T) {
	requestID := "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"

	expectedURL, _ := url.Parse("/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")
	res := dh.RequestResource{}
	router := mux.NewRouter()

	res.RegisterRoutes(router)

	u, err := res.GetRequestURL(requestID)

	if err != nil {
		t.Error(err)
	}

	if *u != *expectedURL {
		t.Errorf(`GetRequestURL('%s') = %q want %q`, requestID, u, expectedURL)
	}
}