@@ -1061,13 +1061,12 @@ func TestListActors_PageSizeValidation(t *testing.T) {
10611061 t .Errorf ("expected InvalidArgument error for negative page_size, got: %v" , err )
10621062 }
10631063
1064- // 2. Page size exceeding maxPageSize (1000)
1065- _ , err = tc .client .ListActors (context .Background (), & ateapipb.ListActorsRequest {
1064+ // 2. Page size exceeding maxPageSize (1000) is coerced silently.
1065+ if _ , err : = tc .client .ListActors (context .Background (), & ateapipb.ListActorsRequest {
10661066 Atespace : testAtespace ,
10671067 PageSize : 1001 ,
1068- })
1069- if status .Code (err ) != codes .InvalidArgument {
1070- t .Errorf ("expected InvalidArgument error for page_size > 1000, got: %v" , err )
1068+ }); err != nil {
1069+ t .Errorf ("expected page_size > 1000 to be coerced, got error: %v" , err )
10711070 }
10721071}
10731072
@@ -2295,6 +2294,64 @@ func TestValidation(t *testing.T) {
22952294 })
22962295 }
22972296 })
2297+
2298+ t .Run ("ListActors" , func (t * testing.T ) {
2299+ tests := []struct {
2300+ name string
2301+ req * ateapipb.ListActorsRequest
2302+ wantMsg string
2303+ }{{
2304+ "invalid atespace" ,
2305+ & ateapipb.ListActorsRequest {Atespace : "NS1" },
2306+ "atespace: Invalid value" ,
2307+ }, {
2308+ "negative page_size" ,
2309+ & ateapipb.ListActorsRequest {Atespace : "ns1" , PageSize : - 1 },
2310+ "page_size: Invalid value" ,
2311+ }}
2312+ for _ , tt := range tests {
2313+ t .Run (tt .name , func (t * testing.T ) {
2314+ _ , err := tc .client .ListActors (context .Background (), tt .req )
2315+ assertGrpcErrorRegex (t , err , codes .InvalidArgument , tt .wantMsg )
2316+ })
2317+ }
2318+ })
2319+
2320+ t .Run ("ListWorkers" , func (t * testing.T ) {
2321+ tests := []struct {
2322+ name string
2323+ req * ateapipb.ListWorkersRequest
2324+ wantMsg string
2325+ }{{
2326+ "negative page_size" ,
2327+ & ateapipb.ListWorkersRequest {PageSize : - 1 },
2328+ "page_size: Invalid value" ,
2329+ }}
2330+ for _ , tt := range tests {
2331+ t .Run (tt .name , func (t * testing.T ) {
2332+ _ , err := tc .client .ListWorkers (context .Background (), tt .req )
2333+ assertGrpcErrorRegex (t , err , codes .InvalidArgument , tt .wantMsg )
2334+ })
2335+ }
2336+ })
2337+
2338+ t .Run ("ListAtespaces" , func (t * testing.T ) {
2339+ tests := []struct {
2340+ name string
2341+ req * ateapipb.ListAtespacesRequest
2342+ wantMsg string
2343+ }{{
2344+ "negative page_size" ,
2345+ & ateapipb.ListAtespacesRequest {PageSize : - 1 },
2346+ "page_size: Invalid value" ,
2347+ }}
2348+ for _ , tt := range tests {
2349+ t .Run (tt .name , func (t * testing.T ) {
2350+ _ , err := tc .client .ListAtespaces (context .Background (), tt .req )
2351+ assertGrpcErrorRegex (t , err , codes .InvalidArgument , tt .wantMsg )
2352+ })
2353+ }
2354+ })
22982355}
22992356
23002357func TestResumeActor_LockConflict (t * testing.T ) {
0 commit comments