@@ -54,7 +54,7 @@ func TestToolsetEndpoint(t *testing.T) {
5454 want : wantResponse {
5555 statusCode : http .StatusOK ,
5656 version : testutils .MockVersionString ,
57- tools : []string {testutils .MockTool1 .Name , testutils .MockTool2 .Name },
57+ tools : []string {testutils .MockTool1 .GetName () , testutils .MockTool2 .GetName () },
5858 },
5959 },
6060 {
@@ -71,7 +71,7 @@ func TestToolsetEndpoint(t *testing.T) {
7171 want : wantResponse {
7272 statusCode : http .StatusOK ,
7373 version : testutils .MockVersionString ,
74- tools : []string {testutils .MockTool1 .Name },
74+ tools : []string {testutils .MockTool1 .GetName () },
7575 },
7676 },
7777 {
@@ -80,7 +80,7 @@ func TestToolsetEndpoint(t *testing.T) {
8080 want : wantResponse {
8181 statusCode : http .StatusOK ,
8282 version : testutils .MockVersionString ,
83- tools : []string {testutils .MockTool2 .Name },
83+ tools : []string {testutils .MockTool2 .GetName () },
8484 },
8585 },
8686 }
@@ -147,20 +147,20 @@ func TestToolGetEndpoint(t *testing.T) {
147147 }{
148148 {
149149 name : "tool1" ,
150- toolName : testutils .MockTool1 .Name ,
150+ toolName : testutils .MockTool1 .GetName () ,
151151 want : wantResponse {
152152 statusCode : http .StatusOK ,
153153 version : testutils .MockVersionString ,
154- tools : []string {testutils .MockTool1 .Name },
154+ tools : []string {testutils .MockTool1 .GetName () },
155155 },
156156 },
157157 {
158158 name : "tool2" ,
159- toolName : testutils .MockTool2 .Name ,
159+ toolName : testutils .MockTool2 .GetName () ,
160160 want : wantResponse {
161161 statusCode : http .StatusOK ,
162162 version : testutils .MockVersionString ,
163- tools : []string {testutils .MockTool2 .Name },
163+ tools : []string {testutils .MockTool2 .GetName () },
164164 },
165165 },
166166 {
@@ -228,15 +228,15 @@ func TestToolInvokeEndpoint(t *testing.T) {
228228 isErr bool
229229 }{
230230 {
231- name : "tool1 " ,
232- toolName : testutils .MockTool1 .Name ,
231+ name : "tool without param " ,
232+ toolName : testutils .MockTool1 .GetName () ,
233233 requestBody : bytes .NewBuffer ([]byte (`{}` )),
234234 want : "{result:[no_params]}\n " ,
235235 isErr : false ,
236236 },
237237 {
238- name : "tool2 " ,
239- toolName : testutils .MockTool2 .Name ,
238+ name : "tool with params " ,
239+ toolName : testutils .MockTool2 .GetName () ,
240240 requestBody : bytes .NewBuffer ([]byte (`{"param1": 1, "param2": 2}` )),
241241 want : "{result:[some_params]}\n " ,
242242 isErr : false ,
@@ -249,15 +249,15 @@ func TestToolInvokeEndpoint(t *testing.T) {
249249 isErr : true ,
250250 },
251251 {
252- name : "tool4 " ,
253- toolName : testutils .MockTool4 .Name ,
252+ name : "unauthorized tools " ,
253+ toolName : testutils .MockTool4 .GetName () ,
254254 requestBody : bytes .NewBuffer ([]byte (`{}` )),
255255 want : "" ,
256256 isErr : true ,
257257 },
258258 {
259- name : "tool5 " ,
260- toolName : testutils .MockTool5 .Name ,
259+ name : "tool requiring client auth " ,
260+ toolName : testutils .MockTool5 .GetName () ,
261261 requestBody : bytes .NewBuffer ([]byte (`{}` )),
262262 want : "" ,
263263 isErr : true ,
@@ -307,7 +307,7 @@ func TestApiRequestBodyLimit(t *testing.T) {
307307
308308 limit := int (DefaultHTTPMaxRequestBytes )
309309 tooLarge := []byte (fmt .Sprintf (`{"param":"%s"}` , strings .Repeat ("x" , limit )))
310- resp , body , err := runRequest (ts , http .MethodPost , fmt .Sprintf ("/tool/%s/invoke" , testutils .MockTool1 .Name ), bytes .NewReader (tooLarge ), nil )
310+ resp , body , err := runRequest (ts , http .MethodPost , fmt .Sprintf ("/tool/%s/invoke" , testutils .MockTool1 .GetName () ), bytes .NewReader (tooLarge ), nil )
311311 if err != nil {
312312 t .Fatalf ("unexpected error during request: %s" , err )
313313 }
@@ -339,7 +339,7 @@ func TestApiRequestBodyLimitOverride(t *testing.T) {
339339 defer ts .Close ()
340340
341341 tooLarge := []byte (fmt .Sprintf (`{"param":"%s"}` , strings .Repeat ("x" , int (customLimit ))))
342- resp , body , err := runRequest (ts , http .MethodPost , fmt .Sprintf ("/tool/%s/invoke" , testutils .MockTool1 .Name ), bytes .NewReader (tooLarge ), nil )
342+ resp , body , err := runRequest (ts , http .MethodPost , fmt .Sprintf ("/tool/%s/invoke" , testutils .MockTool1 .GetName () ), bytes .NewReader (tooLarge ), nil )
343343 if err != nil {
344344 t .Fatalf ("unexpected error during request: %s" , err )
345345 }
0 commit comments