-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RP adapter: update segment logic #1260
Conversation
@@ -1039,10 +1039,10 @@ private void mergeFirstPartyDataFromUser(ExtUser userExt, ObjectNode result) { | |||
} | |||
} | |||
|
|||
private void enrichWithIabAttribute(ObjectNode target, List<Data> data) { | |||
private void enrichWithIabAttribute(ObjectNode target, List<Data> data, int... segtaxValues) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably to be less cryptic it is better to use Set<Integer>
instead of var-args.
This allows to extract all possible combinations to the class fields, like USER_SEGTAXES and SITE_SEGTAXES.
final JsonNode taxonomyName = ext != null ? ext.get("taxonomyname") : null; | ||
return taxonomyName != null && taxonomyName.isTextual() | ||
&& StringUtils.containsIgnoreCase(taxonomyName.textValue(), "iab"); | ||
private boolean containsSegtaxValue(ObjectNode ext, int... segtaxValues) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be static?
} | ||
|
||
private ObjectNode existingRubiconSiteExtRpTarget(ExtSite siteExt) { | ||
final RubiconSiteExt siteRubiconExt = siteExt != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor. Pls rename siteRubiconExt
to rubiconSiteExt
.
target != null && !target.isEmpty() ? target : null))); | ||
} | ||
|
||
private ObjectNode existingRubiconSiteExtRpTarget(ExtSite siteExt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls rename existingRubiconSiteExtRpTargetOrEmptyNode
.
final ObjectNode firstSiteExtNode = mapper.createObjectNode(); | ||
firstSiteExtNode.put("segtax", 1); | ||
final Data firstDataAttribute = Data.builder() | ||
.segment(singletonList(Segment.builder().id("firstSegmentId") | ||
.build())) | ||
.ext(firstSiteExtNode).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be extracted to givenXXX
method.
} | ||
] | ||
}, | ||
"device": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls keep this test simple as possible and remove not related fields here.
No description provided.