From 76fabc4d81060e4dc78349cecc25a95ac08a1d74 Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Tue, 5 Sep 2023 09:49:41 +0400 Subject: [PATCH] Remove appstock params test --- adapters/appstock/params_test.go | 68 -------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 adapters/appstock/params_test.go diff --git a/adapters/appstock/params_test.go b/adapters/appstock/params_test.go deleted file mode 100644 index 3018a48bda2..00000000000 --- a/adapters/appstock/params_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package appstock - -import ( - "encoding/json" - "testing" - - "github.com/prebid/prebid-server/openrtb_ext" -) - -func TestValidParams(t *testing.T) { - validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") - if err != nil { - t.Fatalf("Failed to fetch the json schema. %v", err) - } - - for _, p := range validParams { - if err := validator.Validate(openrtb_ext.BidderAppstock, json.RawMessage(p)); err != nil { - t.Errorf("Schema rejected valid params: %s", p) - } - } -} - -func TestInvalidParams(t *testing.T) { - validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") - if err != nil { - t.Fatalf("Failed to fetch the json schema. %v", err) - } - - for _, p := range invalidParams { - if err := validator.Validate(openrtb_ext.BidderAppstock, json.RawMessage(p)); err == nil { - t.Errorf("Schema allowed invalid params: %s", p) - } - } -} - -var validParams = []string{ - `{"publisherId": 1}`, - `{"publisherId": "1"}`, - `{"publisherId": 42}`, - `{"publisherId": "42"}`, - `{"host": "example.com", "publisherId": "42"}`, - `{"publisherId": "42", "adUnitId": 123, "adUnitType": "banner"}`, - `{"host": "example.com", "publisherId": "42", "adUnitId": 123, "adUnitType": "banner"}`, -} - -var invalidParams = []string{ - `null`, - `nil`, - ``, - `[]`, - `true`, - `{}`, - `{"host": "example.com". "publisherId": 1}`, - - `{"host": "example.com"}`, - - `{"publisherId": ""}`, - `{"publisherId": 0}`, - `{"publisherId": "0"}`, - `{"publisherId": -1}`, - `{"publisherId": "-1"}`, - `{"publisherId": 01}`, - `{"publisherId": "01"}`, - `{"publisherId": -01}`, - `{"publisherId": "-01"}`, - `{"publisherId": -42}`, - `{"publisherId": "-42"}`, -}