diff --git a/store/url_test.go b/store/url_test.go index 118d01dbee..1a2569bf81 100644 --- a/store/url_test.go +++ b/store/url_test.go @@ -1,14 +1,23 @@ package store import ( + "fmt" "testing" + "net/http" + "net/http/httptest" + "github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1" "github.com/stretchr/testify/assert" ) func TestURLReader(t *testing.T) { - urlArtifact := v1alpha1.URLArtifact{Path: "https://raw.githubusercontent.com/argoproj/argo/master/examples/hello-world.yaml"} + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, "Hello, client") + })) + defer ts.Close() + + urlArtifact := v1alpha1.URLArtifact{Path: ts.URL} assert.False(t, urlArtifact.VerifyCert) urlReader, err := NewURLReader(&urlArtifact) assert.NotNil(t, urlReader)