(callMethod func(ctx context.Context) ([]reflect.Value, error))
| 330 | } |
| 331 | |
| 332 | func (s *MethodTestSuite) NoActorErrorTest(callMethod func(ctx context.Context) ([]reflect.Value, error)) { |
| 333 | s.Run("AsRemoveActor", func() { |
| 334 | // Call without any actor |
| 335 | _, err := callMethod(context.Background()) |
| 336 | s.ErrorIs(err, dbauthz.ErrNoActor, "method should return NoActorError error when no actor is provided") |
| 337 | }) |
| 338 | } |
| 339 | |
| 340 | // NotAuthorizedErrorTest runs the given method with an authorizer that will fail authz. |
| 341 | // Asserts that the error returned is a NotAuthorizedError. |