-
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
Add timestamp and biddercode to event URL - refactored #653
Add timestamp and biddercode to event URL - refactored #653
Conversation
added timestamp field to PutObject
if (timestamp != null) { | ||
try { | ||
Long.parseLong(timestamp); |
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.
NumberUtils.isDigits()
or StringUtils.isDigits()
, (but we still need to check for null bc this value is not required)
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.
Both util methods doesn't guaranteed Long range value checking, so NumberFormatException
can be thrown. Don't think they are useful here.
|
||
updatedPutObjects.add(builder.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.
suggest
for (PutObject putObject : putObjects) {
JsonNode value = putObject.getValue();
if (biddersAllowingVastUpdate.contains(putObject.getBidder()) && value != null) {
final String updatedVastXml = modifyVastXml(value.asText(), putObject.getBidid(),
putObject.getBidder(), accountId, putObject.getTimestamp());
value = new TextNode(updatedVastXml);
}
updatedPutObjects.add(putObject.toBuilder()
// remove "/vtrack" specific fields
.bidid(null)
.bidder(null)
.timestamp(null)
.value(value)
.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.
kind of taste-)
@@ -1072,35 +1071,63 @@ public void cachePutObjectsShouldModifyVastAndCachePutObjects() throws IOExcepti | |||
// given | |||
final PutObject firstPutObject = PutObject.builder() | |||
.type("xml") | |||
.bidid("biddid1") | |||
.bidid("bidId1") |
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.
I'd also added .timestamp(1231221L)
to test
See parent PR #635