diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-12-01 15:34:55 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2020-12-01 15:34:55 +0100 |
commit | 6cd12911f4d3aa4c6a75c922f9de231e2cf309dd (patch) | |
tree | a5a39e7e41d4354b8489ae531435c032870ded56 /reqres_test.go | |
parent | 7fd9d2f727a8acf43bb6312888c1450ed2a1eb60 (diff) |
attached url method on endpoint type
Diffstat (limited to 'reqres_test.go')
-rw-r--r-- | reqres_test.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/reqres_test.go b/reqres_test.go index fadfb73..1bb0348 100644 --- a/reqres_test.go +++ b/reqres_test.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "strconv" - "strings" "testing" "crypto/x509" @@ -66,7 +65,7 @@ func TestNewGetEntriesRequest(t *testing.T) { end: fmt.Sprintf("%d", testMaxRange-1), }, } { - url := strings.Join([]string{"http://example.com/", lp.Prefix, string(EndpointGetEntries)}, "/") + url := EndpointGetEntries.Url("http://example.com/", lp.Prefix) r, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("must make http request in test %q: %v", table.description, err) @@ -137,7 +136,7 @@ func TestNewGetProofByHashRequest(t *testing.T) { hash: b64(testNodeHash), }, } { - url := strings.Join([]string{"http://example.com/", lp.Prefix, string(EndpointGetProofByHash)}, "/") + url := EndpointGetProofByHash.Url("http://example.com/", lp.Prefix) r, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("must make http request in test %q: %v", table.description, err) @@ -202,7 +201,7 @@ func TestNewGetConsistencyProofRequest(t *testing.T) { second: "2", }, } { - url := strings.Join([]string{"http://example.com/", lp.Prefix, string(EndpointGetConsistencyProof)}, "/") + url := EndpointGetConsistencyProof.Url("http://example.com/", lp.Prefix) r, err := http.NewRequest("GET", url, nil) if err != nil { t.Fatalf("must make http request in test %q: %v", table.description, err) |