go-mock is used to generate mocks of the ArgoCD client.
Follow the installation instructions to get the latest version.
The following example shows how to generate mocks for the projects
API:
MOCK_API="projects"
MOCK_INTERFACE="ProjectServiceClient"
mockgen -package $MOCK_API -destination pkg/clients/mock/$MOCK_API/mock.go github.com/crossplane-contrib/provider-argocd/pkg/clients/$MOCK_API $MOCK_INTERFACE
To automatically regenerate mocks, extend pkg/clients/generate.go
.