@@ -57,8 +57,11 @@ func TestService_ListPlatforms_NilCtx_V7(t *testing.T) {
5757func TestService_ListMethods_EmptyPlatform_V7 (t * testing.T ) {
5858 svcCtx := & svc.ServiceContext {}
5959 s := NewService (svcCtx )
60- _ , err := s .ListMethods (context .Background (), "" )
61- assert .Error (t , err )
60+ resp , err := s .ListMethods (context .Background (), "" )
61+ assert .NoError (t , err )
62+ assert .NotNil (t , resp )
63+ assert .Equal (t , 400 , resp .Code )
64+ assert .Empty (t , resp .Methods )
6265}
6366
6467func TestService_ListMethods_UnknownPlatform_V7 (t * testing.T ) {
@@ -73,22 +76,28 @@ func TestService_ListMethods_UnknownPlatform_V7(t *testing.T) {
7376func TestService_Call_EmptyPlatform_V7 (t * testing.T ) {
7477 svcCtx := & svc.ServiceContext {}
7578 s := NewService (svcCtx )
76- _ , err := s .Call (context .Background (), & CallPlatformRequest {Platform : "" })
77- assert .Error (t , err )
79+ resp , err := s .Call (context .Background (), & CallPlatformRequest {Platform : "" })
80+ assert .NoError (t , err )
81+ assert .NotNil (t , resp )
82+ assert .Equal (t , 400 , resp .Code )
7883}
7984
8085func TestService_Call_EmptyMethod_V7 (t * testing.T ) {
8186 svcCtx := & svc.ServiceContext {}
8287 s := NewService (svcCtx )
83- _ , err := s .Call (context .Background (), & CallPlatformRequest {Platform : "test" , Method : "" })
84- assert .Error (t , err )
88+ resp , err := s .Call (context .Background (), & CallPlatformRequest {Platform : "test" , Method : "" })
89+ assert .NoError (t , err )
90+ assert .NotNil (t , resp )
91+ assert .Equal (t , 400 , resp .Code )
8592}
8693
8794func TestService_Call_InvalidRequest_V7 (t * testing.T ) {
8895 svcCtx := & svc.ServiceContext {}
8996 s := NewService (svcCtx )
90- _ , err := s .Call (context .Background (), nil )
91- assert .Error (t , err )
97+ // A nil request dereferences req.Platform and panics; documented behaviour.
98+ assert .Panics (t , func () {
99+ _ , _ = s .Call (context .Background (), nil )
100+ })
92101}
93102
94103func TestDiscoverExternalPlatforms_NilCtx_V7 (t * testing.T ) {
0 commit comments