commercetools / commercetools-sync-java

Java library for importing and syncing (taking care of changes) data into one or more commercetools projects from external data files or from another commercetools project.
https://commercetools.github.io/commercetools-sync-java
Apache License 2.0
32 stars 37 forks source link

Fix npe in validation and transformation #1102

Closed salander85 closed 11 months ago

salander85 commented 11 months ago

Summary

The sync breaks when the referenced keys of a resource are null / "null". JIRA: https://commercetools.atlassian.net/browse/DEVX-274

Description

After the migration to java-sdk-v2 the graphQl requests changed from a SphereRequest with deserialization of JavaObjects via Jackson to this implementation using object-mapper to map the data-object of GraphQlResult.

The fix in ProductBatchValidator was done, because the given resource drafts might not be transformed by the tool and therefore could have invalid values.

Relevant Issues

https://github.com/commercetools/commercetools-sync-java/issues/1101

codecov-commenter commented 11 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0f91d9a) 97.58% compared to head (aa29202) 97.63%. Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1102 +/- ## ============================================ + Coverage 97.58% 97.63% +0.04% - Complexity 2655 2662 +7 ============================================ Files 229 229 Lines 8455 8459 +4 Branches 510 513 +3 ============================================ + Hits 8251 8259 +8 + Misses 131 128 -3 + Partials 73 72 -1 ``` | [Files](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools) | Coverage Δ | | |---|---|---| | [...tools/sync/commons/helpers/BaseBatchValidator.java](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#diff-c3JjL21haW4vamF2YS9jb20vY29tbWVyY2V0b29scy9zeW5jL2NvbW1vbnMvaGVscGVycy9CYXNlQmF0Y2hWYWxpZGF0b3IuamF2YQ==) | `100.00% <ø> (+13.63%)` | :arrow_up: | | [...s/sync/products/helpers/ProductBatchValidator.java](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#diff-c3JjL21haW4vamF2YS9jb20vY29tbWVyY2V0b29scy9zeW5jL3Byb2R1Y3RzL2hlbHBlcnMvUHJvZHVjdEJhdGNoVmFsaWRhdG9yLmphdmE=) | `100.00% <100.00%> (ø)` | | | [...roducttypes/helpers/ProductTypeBatchValidator.java](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#diff-c3JjL21haW4vamF2YS9jb20vY29tbWVyY2V0b29scy9zeW5jL3Byb2R1Y3R0eXBlcy9oZWxwZXJzL1Byb2R1Y3RUeXBlQmF0Y2hWYWxpZGF0b3IuamF2YQ==) | `100.00% <100.00%> (ø)` | | | [.../commercetools/sync/services/impl/BaseService.java](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#diff-c3JjL21haW4vamF2YS9jb20vY29tbWVyY2V0b29scy9zeW5jL3NlcnZpY2VzL2ltcGwvQmFzZVNlcnZpY2UuamF2YQ==) | `96.82% <100.00%> (+0.07%)` | :arrow_up: | | [...s/sync/services/impl/BaseTransformServiceImpl.java](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#diff-c3JjL21haW4vamF2YS9jb20vY29tbWVyY2V0b29scy9zeW5jL3NlcnZpY2VzL2ltcGwvQmFzZVRyYW5zZm9ybVNlcnZpY2VJbXBsLmphdmE=) | `87.50% <100.00%> (+1.65%)` | :arrow_up: | | [...tools/sync/commons/utils/CustomValueConverter.java](https://app.codecov.io/gh/commercetools/commercetools-sync-java/pull/1102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#diff-c3JjL21haW4vamF2YS9jb20vY29tbWVyY2V0b29scy9zeW5jL2NvbW1vbnMvdXRpbHMvQ3VzdG9tVmFsdWVDb252ZXJ0ZXIuamF2YQ==) | `77.77% <75.00%> (-2.23%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.