Skip to content

Commit

Permalink
add error case for BuildSyncers
Browse files Browse the repository at this point in the history
addresses #3082 (comment)
  • Loading branch information
onkarvhanumante committed Sep 8, 2023
1 parent 56da6aa commit de6d33a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions usersync/syncersbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ func TestBuildSyncers(t *testing.T) {
"bidder1": "https://bidder.com/iframe?redirect=http%3A%2F%2Fhostoverride.com%2Fbidder1%2Fhost",
},
},
{
description: "parent-and-alias-cannot-have-same-syncer-key",
givenConfig: config.Configuration{ExternalURL: "http://host.com", UserSync: config.UserSync{ExternalURL: "http://hostoverride.com", RedirectURL: "{{.ExternalURL}}/{{.SyncerKey}}/host"}},
givenBidderInfos: map[string]config.BidderInfo{
"bidder1": {Syncer: &config.Syncer{Key: "key", IFrame: iframeConfig}},
"bidder2": {AliasOf: "bidder1", Syncer: &config.Syncer{Key: "key", IFrame: iframeConfig}},
},
expectedErrors: []string{"syncer key of alias bidder bidder2 is same as the syncer key for its parent bidder bidder1"},
},
}

for _, test := range testCases {
Expand Down

0 comments on commit de6d33a

Please sign in to comment.