diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-11-30 20:42:05 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-11-30 20:42:05 +0100 |
commit | 868366cf35e2e649fe7265201d527dbb76bbaf68 (patch) | |
tree | 2c920dfb6c65382779179c69895c9fcdb542d6af /reqres_test.go | |
parent | 60394fb5352d9869946859cf534c36c92be51700 (diff) |
added an endpoint type
Diffstat (limited to 'reqres_test.go')
-rw-r--r-- | reqres_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/reqres_test.go b/reqres_test.go index 1a6304b..8334bd7 100644 --- a/reqres_test.go +++ b/reqres_test.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "strconv" + "strings" "testing" "crypto/x509" @@ -65,7 +66,8 @@ func TestNewGetEntriesRequest(t *testing.T) { end: fmt.Sprintf("%d", testMaxRange-1), }, } { - r, err := http.NewRequest("GET", "http://example.com/"+lp.Prefix+"/get-entries", nil) + url := strings.Join([]string{"http://example.com/", lp.Prefix, EndpointGetEntries.String()}, "/") + r, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("must make http request in test %q: %v", table.description, err) } @@ -135,7 +137,8 @@ func TestNewGetProofByHashRequest(t *testing.T) { hash: b64(testNodeHash), }, } { - r, err := http.NewRequest("GET", "http://example.com/"+lp.Prefix+"/get-proof-by-hash", nil) + url := strings.Join([]string{"http://example.com/", lp.Prefix, EndpointGetProofByHash.String()}, "/") + r, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("must make http request in test %q: %v", table.description, err) } @@ -199,7 +202,8 @@ func TestNewGetConsistencyProofRequest(t *testing.T) { second: "2", }, } { - r, err := http.NewRequest("GET", "http://example.com/"+lp.Prefix+"/get-consistency-proof", nil) + url := strings.Join([]string{"http://example.com/", lp.Prefix, EndpointGetConsistencyProof.String()}, "/") + r, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("must make http request in test %q: %v", table.description, err) } |