You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The external package contains logic for sending requests to external services needed by hng_boilerplate. Currently, it has no factory for setting up the logic properly, there is no interface binding all external services hence mocking is difficult. And this package has no unit tests.
Acceptance Criteria
Ensure all services dependent on external package and its logic retain their logic and functionality
Expose the external package as an interface for communicating with any external package
Update Mocks for the external package
Include unit tests with good coverage for the package
Description
The
external
package contains logic for sending requests to external services needed by hng_boilerplate. Currently, it has no factory for setting up the logic properly, there is no interface binding all external services hence mocking is difficult. And this package has no unit tests.Acceptance Criteria
external
package and its logic retain their logic and functionalityexternal
package as an interface for communicating with any external packageexternal
packageRequirements
Purpose
Changes to be made:
The current external folder looks like this:
I will be updating it to this:
interface.go
defines the required interface for external service interactions.external.go
provides a generic function for sending external requests.request/request.go
serves as a configurable external request handler using the factory pattern with options.mocks/
contains generated mocks to inject the external package when testing services that depend on it.ipstack/
contains implementation details for the IpStack API.*_test.go
files contain unit test for functions.Update external to use interface Refactor the external package to use an interface #376
Properly initialize
external.ExternalRequest
using factory method in every package using itExpected Outcome
external
works as it shouldThe text was updated successfully, but these errors were encountered: