File tree Expand file tree Collapse file tree
main/java/org/prebid/server/analytics/reporter/liveintent
test/java/org/prebid/server/analytics/reporter/liveintent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ private List<Activity> getActivities(AuctionContext auctionContext) {
127127 .toList ();
128128 }
129129
130- private Optional < Float > getTreatmentRate (List <Activity > activities ) {
130+ private Float getTreatmentRate (List <Activity > activities ) {
131131 return activities
132132 .stream ()
133133 .filter (activity -> "liveintent-treatment-rate" .equals (activity .name ()))
@@ -139,7 +139,8 @@ private Optional<Float> getTreatmentRate(List<Activity> activities) {
139139 logger .warn ("Invalid treatment rate value: {}" , activity .status ());
140140 throw e ;
141141 }
142- });
142+ })
143+ .orElse (null );
143144 }
144145
145146 private boolean isEnriched (List <Activity > activities ) {
Original file line number Diff line number Diff line change 55import lombok .Value ;
66
77import java .math .BigDecimal ;
8- import java .util .Optional ;
98
109@ Data
1110@ Builder (toBuilder = true )
@@ -17,7 +16,7 @@ public class PbsjBid {
1716 BigDecimal price ;
1817 String adUnitId ;
1918 String currency ;
20- Optional < Float > treatmentRate ;
19+ Float treatmentRate ;
2120 Long timestamp ;
2221 String partnerId ;
2322}
Original file line number Diff line number Diff line change 3939import java .util .Arrays ;
4040import java .util .EnumMap ;
4141import java .util .List ;
42- import java .util .Optional ;
4342
4443import static org .assertj .core .api .Assertions .assertThat ;
4544import static org .mockito .ArgumentMatchers .anyLong ;
@@ -121,7 +120,7 @@ public void shouldSendAllBidsToLiveIntent() {
121120 .adUnitId ("ad-unit-id" )
122121 .enriched (true )
123122 .currency ("USD" )
124- .treatmentRate (Optional . of ( 0.5f ) )
123+ .treatmentRate (0.5f )
125124 .timestamp (0L )
126125 .partnerId ("pbsj" )
127126 .build ()
@@ -153,7 +152,7 @@ public void shouldSendAllBidsToLiveIntentNotEnriched() {
153152 .adUnitId ("ad-unit-id" )
154153 .enriched (false )
155154 .currency ("USD" )
156- .treatmentRate (Optional . of ( 0.5f ) )
155+ .treatmentRate (0.5f )
157156 .timestamp (0L )
158157 .partnerId ("pbsj" )
159158 .build ()
@@ -185,8 +184,8 @@ public void shouldSendAllBidsToLiveIntentNoTreatmentRate() {
185184 .adUnitId ("ad-unit-id" )
186185 .enriched (false )
187186 .currency ("USD" )
188- .treatmentRate (Optional .empty ())
189187 .timestamp (0L )
188+ .treatmentRate (null )
190189 .partnerId ("pbsj" )
191190 .build ()
192191 ));
You can’t perform that action at this time.
0 commit comments