Skip to content
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

438: Reference resolution of Product references (and set of) as an attribute of nested type #439

Merged
merged 25 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9d95885
#438: Use JsonNode#findParents methods to traverse set of object of r…
heshamMassoud Sep 3, 2019
5eaef16
#438: Add/update first draft of unit tests.
heshamMassoud Sep 3, 2019
010f34c
#438: Add unit tests for nested attributes with product references.
heshamMassoud Sep 4, 2019
a518351
#438: Refactor code.
heshamMassoud Sep 4, 2019
9fc1299
#438: Fix unit tests names.
heshamMassoud Sep 4, 2019
ab995a8
#438: Remove unneeded test.
heshamMassoud Sep 4, 2019
4ba6024
#438: Make Checkstyle happy.
heshamMassoud Sep 4, 2019
f4f1cd4
#438: Disable unit test.
heshamMassoud Sep 4, 2019
c870d38
#438: Move IT to own class.
heshamMassoud Sep 4, 2019
3264cce
#438: Return right away.
heshamMassoud Sep 4, 2019
fca8c55
#438: Add ITs for attribute product references and nested attribute p…
heshamMassoud Sep 4, 2019
28c7f81
#438: Add product type resource with references.
heshamMassoud Sep 4, 2019
6564d5a
#438: Add release notes entry.
heshamMassoud Sep 5, 2019
b273582
#438: Remove todo comment.
heshamMassoud Sep 5, 2019
a680045
#438: Add comment on disabled test.
heshamMassoud Sep 5, 2019
99ec29d
#438: Use keys instead of uuids in test resources.
heshamMassoud Sep 5, 2019
792ab66
#438: Use better naming for tests.
heshamMassoud Sep 5, 2019
2cf4f3c
#438: Use better test naming.
heshamMassoud Sep 5, 2019
7d8b250
#438: Use constants instead of new strings.
heshamMassoud Sep 5, 2019
636205c
#438: Use constants instead of actual strings.
heshamMassoud Sep 5, 2019
5ad7c95
#438: Add assertions on the generated actions.
heshamMassoud Sep 5, 2019
341ce7b
#438: Make Checkstyle happy.
heshamMassoud Sep 5, 2019
91fad10
#438: Rename variable.
heshamMassoud Sep 5, 2019
564c53c
#438: Add condition for NullNode.
heshamMassoud Sep 5, 2019
9169802
#438: Fix failing ITs.
heshamMassoud Sep 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@

-->

<!--
### 1.5.0 - Sept 6, 2019
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/1.4.1...1.5.0) |
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/1.5.0/) |
[Jar](https://bintray.com/commercetools/maven/commercetools-sync-java/1.5.0)

- 🎉 **New Features** (1)
- **Product Sync** - Added support for resolving product references on attributes of type `Reference`, `Set` of `Reference`, `NestedType` or `Set` of `NestedType`. [#438](https://github.com/commercetools/commercetools-sync-java/issues/438)

-->

### 1.4.1 - Sept 2, 2019
[Commits](https://github.com/commercetools/commercetools-sync-java/compare/1.4.0...1.4.1) |
[Javadoc](https://commercetools.github.io/commercetools-sync-java/v/1.4.1/) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,42 +779,6 @@ void sync_withSameDraftsWithChangesInBatch_ShouldRetryUpdateBecauseOfConcurrentM
assertThat(warningCallBackMessages).isEmpty();
}

@Test
void sync_withProductBundle_shouldCreateProductReferencingExistingProduct() {
final ProductDraft productDraft = createProductDraftBuilder(PRODUCT_KEY_2_RESOURCE_PATH,
ProductType.referenceOfId(productType.getKey()))
.taxCategory(null)
.state(null)
.build();

// Creating the attribute draft with the product reference
final AttributeDraft productReferenceAttribute =
AttributeDraft.of("product-reference", Reference.of(Product.referenceTypeId(), product.getKey()));

// Creating the product variant draft with the product reference attribute
final ProductVariantDraft draftMasterVariant = productDraft.getMasterVariant();
assertThat(draftMasterVariant).isNotNull();
final List<AttributeDraft> attributes = draftMasterVariant.getAttributes();
attributes.add(productReferenceAttribute);
final ProductVariantDraft masterVariant = ProductVariantDraftBuilder.of(draftMasterVariant)
.attributes(attributes)
.build();

final ProductDraft productDraftWithProductReference = ProductDraftBuilder.of(productDraft)
.masterVariant(masterVariant)
.build();


final ProductSync productSync = new ProductSync(syncOptions);
final ProductSyncStatistics syncStatistics =
executeBlocking(productSync.sync(singletonList(productDraftWithProductReference)));

assertThat(syncStatistics).hasValues(1, 1, 0, 0);
assertThat(errorCallBackExceptions).isEmpty();
assertThat(errorCallBackMessages).isEmpty();
assertThat(warningCallBackMessages).isEmpty();
}

@Test
void sync_withProductContainingAttributeChanges_shouldSyncProductCorrectly() {
// preparation
Expand Down
Loading