Skip to content

[S3CrtClient]: please declare client methods 'virtual', to support testability #3715

@grrtrr

Description

@grrtrr

Problem description

Most of the S3CrtClient methods have been declared as virtual, which supports a well-established pattern of creating a mock class based on the parent class.

The only exceptions are the following methods, which are thus very difficult to test:

  • Aws::String GeneratePresignedUrl (x 2)
  • Aws::String GeneratePresignedUrlWithSSES3 (x 2)
  • Aws::String GeneratePresignedUrlWithSSEKMS (x 2)
  • Aws::String GeneratePresignedUrlWithSSEC (x 2)

(It is a bit unfortunate that these return Aws::String instead of Aws::Outcome<Aws::String>, since the only way to detect an error is to detect if the returned result is empty; but this would mean a breaking change).

It would also be nice to have the following public methods as virtual:

  • void OverrideEndpoint()
  • Aws::Client::XmlOutcome GenerateXmlOutcome
  • Aws::Client::StreamOutcome GenerateStreamOutcome

Proposal

Please declare the above listed methods as virtual.

Other Information

This is present on today's master (1.11.580 and above).

Acknowledgements

  • I may be able to implement this feature request.
  • This feature does not incur a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions