Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement utility class and helper classes for CustomObjectSync #561
Conversation
codecov-commenter
commented
Sep 10, 2020
•
Codecov Report
@@ Coverage Diff @@
## master #561 +/- ##
============================================
- Coverage 99.19% 99.17% -0.03%
- Complexity 1851 1854 +3
============================================
Files 157 159 +2
Lines 4584 4592 +8
Branches 268 268
============================================
+ Hits 4547 4554 +7
- Misses 19 20 +1
Partials 18 18
Continue to review full report at Codecov.
|
...va/com/commercetools/sync/customobjects/utils/CustomObjectSyncUtils.java
Outdated
Show resolved
Hide resolved
...va/com/commercetools/sync/customobjects/utils/CustomObjectSyncUtils.java
Outdated
Show resolved
Hide resolved
...commercetools/sync/customobjects/helpers/CustomObjectSyncStatistics.java
Outdated
Show resolved
Hide resolved
...commercetools/sync/customobjects/helpers/CustomObjectSyncStatistics.java
Outdated
Show resolved
Hide resolved
...com/commercetools/sync/customobjects/CustomObjectSyncOptionsBuilder.java
Show resolved
Hide resolved
...om/commercetools/sync/customobjects/utils/CustomObjectSyncUtilsTest.java
Show resolved
Hide resolved
...om/commercetools/sync/customobjects/utils/CustomObjectSyncUtilsTest.java
Outdated
Show resolved
Hide resolved
...om/commercetools/sync/customobjects/utils/CustomObjectSyncUtilsTest.java
Outdated
Show resolved
Hide resolved
| @@ -37,4 +44,6 @@ | |||
| beforeCreateCallback); | |||
| } | |||
|
|
|||
|
|
|||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| JsonNode oldValue = oldCustomObject.getValue(); | ||
| JsonNode newValue = newCustomObject.getValue(); | ||
|
|
||
| return oldValue.equals(newValue); |
This comment has been minimized.
This comment has been minimized.
ahmetoz
Sep 10, 2020
Member
this could be a one-liner, also it looks like you added a utility to be able to test without the Sync method.
...va/com/commercetools/sync/customobjects/utils/CustomObjectSyncUtils.java
Outdated
Show resolved
Hide resolved
...va/com/commercetools/sync/customobjects/utils/CustomObjectSyncUtils.java
Outdated
Show resolved
Hide resolved
| JsonNode actualObj = new ObjectMapper().readTree("true"); | ||
| JsonNode mockedObj = new ObjectMapper().readTree("true"); | ||
|
|
||
| newCustomObjectdraft = CustomObjectDraft.ofUnversionedUpsert(container, key, actualObj); |
This comment has been minimized.
This comment has been minimized.
ahmetoz
Sep 10, 2020
Member
you could refactor the mocking CustomObject into a private method, also checks like isBoolean, isNumber is not necessary just test the hasIdenticalValue method, but I am also thinking we are doing extra tests which should be part of the Sync class, here it looks like to me just testing the JsonNode which is not necessary to test separately.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
lojzatran
commented on src/test/java/com/commercetools/sync/customobjects/utils/CustomObjectSyncUtilsTest.java in ac2a28b
Sep 10, 2020
|
Remove the spaces |
leungkinghin commentedSep 10, 2020
•
edited
Summary
Add SyncUtils, SyncOptions, SyncOptionsBuilder, SyncStatistic for CustomObject sync process.
Description
Implement utility class to check the json value differences between old and new custom objects.
Implement sync options class for CTP project interaction.
Implement sync statistic class for sync process result.
Relevant Issues
#565
Todo
Hints for Review
UpdateActionUtils is not implemented because UpdateAction is not applicable in CustomObjects.
JSON value comparison is carried out in SyncUtils