Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
orz25 committed Feb 24, 2025
1 parent 16281dd commit 04cf756
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/xscanalyticsevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ func TestXscAddAndUpdateGeneralEvent(t *testing.T) {
func createXscMockServerForGeneralEvent(t *testing.T) (mockServer *httptest.Server, analyticsService *services.AnalyticsEventService) {
mockServer = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch {
case strings.Contains(r.RequestURI, "/xray/api/v1/system/version") && r.Method == http.MethodGet:
w.WriteHeader(http.StatusOK)
_, err := w.Write([]byte(utils.MinXrayVersionXscTransitionToXray))
assert.NoError(t, err)
case strings.Contains(r.RequestURI, "/xray/api/v1/xsc/event") && r.Method == http.MethodPost:
w.WriteHeader(http.StatusCreated)
_, err := w.Write([]byte(TestMultiScanIdResponse))
Expand Down

0 comments on commit 04cf756

Please sign in to comment.