@@ -517,11 +517,6 @@ func Test_GetCommit(t *testing.T) {
517
517
},
518
518
},
519
519
}
520
- // This one currently isn't defined in the mock package we're using.
521
- var mockEndpointPattern = mock.EndpointPattern {
522
- Pattern :"/repos/{owner}/{repo}/commits/{sha}" ,
523
- Method :"GET" ,
524
- }
525
520
526
521
tests := []struct {
527
522
name string
@@ -535,7 +530,7 @@ func Test_GetCommit(t *testing.T) {
535
530
name :"successful commit fetch" ,
536
531
mockedClient :mock .NewMockedHTTPClient (
537
532
mock .WithRequestMatchHandler (
538
- mockEndpointPattern ,
533
+ mock . GetReposCommitsByOwnerByRepoByRef ,
539
534
mockResponse (t ,http .StatusOK ,mockCommit ),
540
535
),
541
536
),
@@ -551,7 +546,7 @@ func Test_GetCommit(t *testing.T) {
551
546
name :"commit fetch fails" ,
552
547
mockedClient :mock .NewMockedHTTPClient (
553
548
mock .WithRequestMatchHandler (
554
- mockEndpointPattern ,
549
+ mock . GetReposCommitsByOwnerByRepoByRef ,
555
550
http .HandlerFunc (func (w http.ResponseWriter ,_ * http.Request ) {
556
551
w .WriteHeader (http .StatusNotFound )
557
552
_ ,_ = w .Write ([]byte (`{"message": "Not Found"}` ))