@@ -120,13 +120,11 @@ func TestTokenExpiredOrExpiring(t *testing.T) {
120120}
121121
122122func TestCredentialFillInput (t * testing.T ) {
123- ep := & transport.Endpoint {
124- URL : url.URL {
125- Scheme : "https" ,
126- Host : "github.com" ,
127- Path : "/owner/repo.git" ,
128- User : url .User ("myuser" ),
129- },
123+ ep := & url.URL {
124+ Scheme : "https" ,
125+ Host : "github.com" ,
126+ Path : "/owner/repo.git" ,
127+ User : url .User ("myuser" ),
130128 }
131129
132130 got := credentialFillInput (ep )
@@ -144,20 +142,18 @@ func TestCredentialFillInputNilEndpoint(t *testing.T) {
144142}
145143
146144func TestCredentialFillInputEmptyHost (t * testing.T ) {
147- ep := & transport. Endpoint { URL : url.URL {Scheme : "https" } }
145+ ep := & url.URL {Scheme : "https" }
148146 got := credentialFillInput (ep )
149147 if got != "" {
150148 t .Errorf ("expected empty string for empty host, got %q" , got )
151149 }
152150}
153151
154152func TestCredentialFillInputNoUser (t * testing.T ) {
155- ep := & transport.Endpoint {
156- URL : url.URL {
157- Scheme : "https" ,
158- Host : "example.com" ,
159- Path : "/repo.git" ,
160- },
153+ ep := & url.URL {
154+ Scheme : "https" ,
155+ Host : "example.com" ,
156+ Path : "/repo.git" ,
161157 }
162158 got := credentialFillInput (ep )
163159 want := "protocol=https\n host=example.com\n path=repo.git\n \n "
@@ -227,17 +223,17 @@ func TestParseCredentialOutput(t *testing.T) {
227223}
228224
229225func TestResolve (t * testing.T ) {
230- ep , err := transport .NewEndpoint ("https://example.com/repo.git" )
226+ ep , err := transport .ParseURL ("https://example.com/repo.git" )
231227 if err != nil {
232228 t .Fatal (err )
233229 }
234230
235- sshEP := & transport. Endpoint { URL : url.URL {Scheme : "ssh" , Host : "example.com" , Path : "/repo.git" } }
231+ sshEP := & url.URL {Scheme : "ssh" , Host : "example.com" , Path : "/repo.git" }
236232
237233 tests := []struct {
238234 name string
239235 raw Endpoint
240- ep * transport. Endpoint
236+ ep * url. URL
241237 mockCred func (ctx context.Context , input string ) ([]byte , error )
242238 wantType string // "token", "basic", "nil"
243239 wantUser string
@@ -414,17 +410,17 @@ func TestExplicitAuth(t *testing.T) {
414410func TestEndpointBaseURL (t * testing.T ) {
415411 tests := []struct {
416412 name string
417- ep * transport. Endpoint
413+ ep * url. URL
418414 want string
419415 }{
420416 {
421417 name : "https host" ,
422- ep : & transport. Endpoint { URL : url.URL {Scheme : "https" , Host : "example.com" } },
418+ ep : & url.URL {Scheme : "https" , Host : "example.com" },
423419 want : "https://example.com" ,
424420 },
425421 {
426422 name : "http host with port" ,
427- ep : & transport. Endpoint { URL : url.URL {Scheme : "http" , Host : "example.com:8080" } },
423+ ep : & url.URL {Scheme : "http" , Host : "example.com:8080" },
428424 want : "http://example.com:8080" ,
429425 },
430426 {
@@ -447,17 +443,17 @@ func TestEndpointBaseURL(t *testing.T) {
447443func TestEndpointCredentialHost (t * testing.T ) {
448444 tests := []struct {
449445 name string
450- ep * transport. Endpoint
446+ ep * url. URL
451447 want string
452448 }{
453449 {
454450 name : "host without port" ,
455- ep : & transport. Endpoint { URL : url.URL {Host : "example.com" } },
451+ ep : & url.URL {Host : "example.com" },
456452 want : "example.com" ,
457453 },
458454 {
459455 name : "host with port" ,
460- ep : & transport. Endpoint { URL : url.URL {Host : "example.com:8080" } },
456+ ep : & url.URL {Host : "example.com:8080" },
461457 want : "example.com:8080" ,
462458 },
463459 {
0 commit comments