-
Notifications
You must be signed in to change notification settings - Fork 504
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
Fix: batch update edge with edgeId and unmatched sortKeys will create a new edge #819
Conversation
… a new edge Fix #818 Change-Id: Ic929a4267fc411c156a32e5b381d314f382ebc9a
Codecov Report
@@ Coverage Diff @@
## master #819 +/- ##
============================================
- Coverage 71.13% 71.04% -0.09%
- Complexity 4331 4337 +6
============================================
Files 283 283
Lines 20957 20969 +12
Branches 2957 2960 +3
============================================
- Hits 14908 14898 -10
- Misses 4568 4583 +15
- Partials 1481 1488 +7
Continue to review full report at Codecov.
|
sortKeyValue.equals(oldSortKeyValue), | ||
"The value of sort key '%s' either be null " + | ||
"or equal with origin '%s', but got '%s'", | ||
sortKey, oldSortKeyValue, sortKeyValue); |
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.
compare the two ids
d4a2183
to
719d772
Compare
Change-Id: I0a100d72dd7572cec9cd30b36674eb1f271ddc98
if (newEdge.id != null) { | ||
E.checkArgument(edgeId.equals(newEdge.id), | ||
"The sort key values either be null " + | ||
"or equal with origin"); |
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.
equal to
public void testBatchUpdate() throws IOException { | ||
String outVId = getVertexId("person", "name", "marko"); | ||
String inVId = getVertexId("person", "name", "josh"); | ||
// create |
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.
Create
String content = assertResponseStatus(201, r); | ||
String id = parseId(content); | ||
|
||
// update edge with edgeId |
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.
ditto
+ "\"create_if_not_exist\":true" | ||
+ "}", id, outVId, inVId); | ||
r = client().put(path + "batch", edge, ImmutableMap.of()); | ||
// Now allowed to modify sortkey values, the property date has changed |
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.
the property “date” has changed
+ "}", outVId, inVId); | ||
r = client().put(path + "batch", edge, ImmutableMap.of()); | ||
// Add a new edge when sortkey value has changed | ||
assertResponseStatus(200, r); |
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.
query to assert two different edges
Assert.assertTrue(content.contains( | ||
"either be null or equal with origin")); | ||
|
||
// update edge without edgeId |
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.
Update
f1e5c1d
to
cfded54
Compare
Change-Id: I21ce599336e8f894457756f61c5a0fb546290ac0
cfded54
to
708cd4b
Compare
Fix #818
Change-Id: Ic929a4267fc411c156a32e5b381d314f382ebc9a