Skip to content

Commit 3ee1d38

Browse files
authored
Merge pull request #43 from UnityTech/PPS-669
[PPS-669] Always passing source.fd
2 parents f01a90e + 329bb02 commit 3ee1d38

8 files changed

+15
-15
lines changed

audio_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func TestAudio_Validate(t *testing.T) {
5656
},
5757
CompanionType: []int{VASTCompanionStatic, VASTCompanionHTML},
5858
}
59-
if exp, got := ErrInvalidAudioNoMimes, subject.Validate(); !errors.Is(exp, got) {
59+
if exp, got := ErrInvalidAudioNoMimes, subject.Validate(); !errors.Is(got, exp) {
6060
t.Fatalf("expected %v, got %v", exp, got)
6161
}
6262
}

bid_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ func TestBid(t *testing.T) {
3535

3636
func TestBid_Validate(t *testing.T) {
3737
subject := &Bid{}
38-
if exp, got := ErrInvalidBidNoID, subject.Validate(); !errors.Is(exp, got) {
38+
if exp, got := ErrInvalidBidNoID, subject.Validate(); !errors.Is(got, exp) {
3939
t.Fatalf("expected %v, got %v", exp, got)
4040
}
4141
subject = &Bid{ID: "BIDID"}
42-
if exp, got := ErrInvalidBidNoImpID, subject.Validate(); !errors.Is(exp, got) {
42+
if exp, got := ErrInvalidBidNoImpID, subject.Validate(); !errors.Is(got, exp) {
4343
t.Fatalf("expected %v, got %v", exp, got)
4444
}
4545
}

bidrequest_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ func TestBidRequest_complex(t *testing.T) {
7474

7575
func TestBidRequest_Validate(t *testing.T) {
7676
subject := &BidRequest{}
77-
if exp, got := ErrInvalidReqNoID, subject.Validate(); !errors.Is(exp, got) {
77+
if exp, got := ErrInvalidReqNoID, subject.Validate(); !errors.Is(got, exp) {
7878
t.Fatalf("expected %v, got %v", exp, got)
7979
}
8080
subject = &BidRequest{ID: "RID"}
81-
if exp, got := ErrInvalidReqNoImps, subject.Validate(); !errors.Is(exp, got) {
81+
if exp, got := ErrInvalidReqNoImps, subject.Validate(); !errors.Is(got, exp) {
8282
t.Fatalf("expected %v, got %v", exp, got)
8383
}
8484
subject = &BidRequest{ID: "A", Imp: []Impression{{ID: "1"}}, Site: &Site{}, App: &App{}}
85-
if exp, got := ErrInvalidReqMultiInv, subject.Validate(); !errors.Is(exp, got) {
85+
if exp, got := ErrInvalidReqMultiInv, subject.Validate(); !errors.Is(got, exp) {
8686
t.Fatalf("expected %v, got %v", exp, got)
8787
}
8888
}

bidresponse_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ func TestBidResponse_complex(t *testing.T) {
5656

5757
func TestBidResponse_Validate(t *testing.T) {
5858
subject := &BidResponse{}
59-
if exp, got := ErrInvalidRespNoID, subject.Validate(); !errors.Is(exp, got) {
59+
if exp, got := ErrInvalidRespNoID, subject.Validate(); !errors.Is(got, exp) {
6060
t.Fatalf("expected %v, got %v", exp, got)
6161
}
6262
subject = &BidResponse{ID: "RID"}
63-
if exp, got := ErrInvalidRespNoSeatBids, subject.Validate(); !errors.Is(exp, got) {
63+
if exp, got := ErrInvalidRespNoSeatBids, subject.Validate(); !errors.Is(got, exp) {
6464
t.Fatalf("expected %v, got %v", exp, got)
6565
}
6666
}

impression_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ func TestImpression(t *testing.T) {
5555

5656
func TestImpression_Validate(t *testing.T) {
5757
subject := &Impression{}
58-
if exp, got := ErrInvalidImpNoID, subject.Validate(); !errors.Is(exp, got) {
58+
if exp, got := ErrInvalidImpNoID, subject.Validate(); !errors.Is(got, exp) {
5959
t.Fatalf("expected %v, got %v", exp, got)
6060
}
6161
subject = &Impression{ID: "IMPID", Banner: &Banner{}, Video: &Video{}}
62-
if exp, got := ErrInvalidImpMultiAssets, subject.Validate(); !errors.Is(exp, got) {
62+
if exp, got := ErrInvalidImpMultiAssets, subject.Validate(); !errors.Is(got, exp) {
6363
t.Fatalf("expected %v, got %v", exp, got)
6464
}
6565
}

seatbid_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func TestSeatBid_Validate(t *testing.T) {
1111
subject := &SeatBid{}
12-
if exp, got := ErrInvalidSeatBidBid, subject.Validate(); !errors.Is(exp, got) {
12+
if exp, got := ErrInvalidSeatBidBid, subject.Validate(); !errors.Is(got, exp) {
1313
t.Fatalf("expected %v, got %v", exp, got)
1414
}
1515
}

source.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package openrtb
22

33
// Source object describes the nature and behavior of the entity that is the source of the bid request upstream from the exchange.
44
type Source struct {
5-
FinalSaleDecision int `json:"fd,omitempty"` // Entity responsible for the final impression sale decision, where 0 = exchange, 1 = upstream source.
5+
FinalSaleDecision int `json:"fd"` // Entity responsible for the final impression sale decision, where 0 = exchange, 1 = upstream source.
66
TransactionID string `json:"tid,omitempty"` // Transaction ID that must be common across all participants in this bid request (e.g., potentially multiple exchanges).
77
PaymentChain string `json:"pchain,omitempty"` // Payment ID chain string containing embedded syntax described in the TAG Payment ID Protocol v1.0.
88
Ext Extension `json:"ext,omitempty"` // Placeholder for exchange-specific extensions to OpenRTB.

video_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ func TestVideo(t *testing.T) {
5252

5353
func TestVideo_Validate(t *testing.T) {
5454
subject := &Video{}
55-
if exp, got := ErrInvalidVideoNoMimes, subject.Validate(); !errors.Is(exp, got) {
55+
if exp, got := ErrInvalidVideoNoMimes, subject.Validate(); !errors.Is(got, exp) {
5656
t.Fatalf("expected %v, got %v", exp, got)
5757
}
5858
subject = &Video{Mimes: []string{"video/mp4"}}
59-
if exp, got := ErrInvalidVideoNoLinearity, subject.Validate(); !errors.Is(exp, got) {
59+
if exp, got := ErrInvalidVideoNoLinearity, subject.Validate(); !errors.Is(got, exp) {
6060
t.Fatalf("expected %v, got %v", exp, got)
6161
}
6262
subject = &Video{
@@ -65,7 +65,7 @@ func TestVideo_Validate(t *testing.T) {
6565
Linearity: VideoLinearityNonLinear,
6666
Mimes: []string{"video/mp4"},
6767
}
68-
if exp, got := ErrInvalidVideoNoProtocols, subject.Validate(); !errors.Is(exp, got) {
68+
if exp, got := ErrInvalidVideoNoProtocols, subject.Validate(); !errors.Is(got, exp) {
6969
t.Fatalf("expected %v, got %v", exp, got)
7070
}
7171
}

0 commit comments

Comments
 (0)