Skip to content

Commit de0ba8a

Browse files
Merge pull request #658 from commercetools/release5.9.1
New Release 5.9.1
2 parents 6a872ff + 1dfe921 commit de0ba8a

File tree

8 files changed

+316
-17
lines changed

8 files changed

+316
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Example:
221221
##### Download
222222

223223
```bash
224-
docker pull commercetools/commercetools-project-sync:5.9.0
224+
docker pull commercetools/commercetools-project-sync:5.9.1
225225
```
226226
##### Run
227227

@@ -233,14 +233,14 @@ docker run \
233233
-e TARGET_PROJECT_KEY=xxxx \
234234
-e TARGET_CLIENT_ID=xxxx \
235235
-e TARGET_CLIENT_SECRET=xxxx \
236-
commercetools/commercetools-project-sync:5.9.0 -s all
236+
commercetools/commercetools-project-sync:5.9.1 -s all
237237
```
238238

239239

240240
### Examples
241241
- To run the all sync modules from a source project to a target project
242242
```bash
243-
docker run commercetools/commercetools-project-sync:5.9.0 -s all
243+
docker run commercetools/commercetools-project-sync:5.9.1 -s all
244244
```
245245
This will run the following sync modules in the given order:
246246
1. `Type` Sync and `ProductType` Sync and `States` Sync and `TaxCategory` Sync and `CustomObject` Sync in parallel.
@@ -250,70 +250,70 @@ commercetools/commercetools-project-sync:5.9.0 -s all
250250

251251
- To run the type sync
252252
```bash
253-
docker run commercetools/commercetools-project-sync:5.9.0 -s types
253+
docker run commercetools/commercetools-project-sync:5.9.1 -s types
254254
```
255255

256256
- To run the productType sync
257257
```bash
258-
docker run commercetools/commercetools-project-sync:5.9.0 -s productTypes
258+
docker run commercetools/commercetools-project-sync:5.9.1 -s productTypes
259259
```
260260

261261
- To run the states sync
262262
```bash
263-
docker run commercetools/commercetools-project-sync:5.9.0 -s states
263+
docker run commercetools/commercetools-project-sync:5.9.1 -s states
264264
```
265265
- To run the taxCategory sync
266266
```bash
267-
docker run commercetools/commercetools-project-sync:5.9.0 -s taxCategories
267+
docker run commercetools/commercetools-project-sync:5.9.1 -s taxCategories
268268
```
269269

270270
- To run the category sync
271271
```bash
272-
docker run commercetools/commercetools-project-sync:5.9.0 -s categories
272+
docker run commercetools/commercetools-project-sync:5.9.1 -s categories
273273
```
274274

275275
- To run the product sync
276276
```bash
277-
docker run commercetools/commercetools-project-sync:5.9.0 -s products
277+
docker run commercetools/commercetools-project-sync:5.9.1 -s products
278278
```
279279

280280
- To run the cartDiscount sync
281281
```bash
282-
docker run commercetools/commercetools-project-sync:5.9.0 -s cartDiscounts
282+
docker run commercetools/commercetools-project-sync:5.9.1 -s cartDiscounts
283283
```
284284

285285
- To run the inventoryEntry sync
286286
```bash
287-
docker run commercetools/commercetools-project-sync:5.9.0 -s inventoryEntries
287+
docker run commercetools/commercetools-project-sync:5.9.1 -s inventoryEntries
288288
```
289289

290290
- To run the customObject sync
291291
```bash
292-
docker run commercetools/commercetools-project-sync:5.9.0 -s customObjects
292+
docker run commercetools/commercetools-project-sync:5.9.1 -s customObjects
293293
```
294294

295295
- To run the customer sync
296296
```bash
297-
docker run commercetools/commercetools-project-sync:5.9.0 -s customers
297+
docker run commercetools/commercetools-project-sync:5.9.1 -s customers
298298
```
299299

300300
- To run the shoppingList sync
301301
```bash
302-
docker run commercetools/commercetools-project-sync:5.9.0 -s shoppingLists
302+
docker run commercetools/commercetools-project-sync:5.9.1 -s shoppingLists
303303
```
304304
- To run both products and shoppingList sync
305305
```bash
306-
docker run commercetools/commercetools-project-sync:5.9.0 -s products shoppingLists
306+
docker run commercetools/commercetools-project-sync:5.9.1 -s products shoppingLists
307307
```
308308

309309
- To run type, productType and shoppingList sync
310310
```bash
311-
docker run commercetools/commercetools-project-sync:5.9.0 -s types productTypes shoppingLists
311+
docker run commercetools/commercetools-project-sync:5.9.1 -s types productTypes shoppingLists
312312
```
313313

314314
- To run all sync modules using a runner name
315315
```bash
316-
docker run commercetools/commercetools-project-sync:5.9.0 -s all -r myRunnerName
316+
docker run commercetools/commercetools-project-sync:5.9.1 -s all -r myRunnerName
317317
```
318318

319319
## Scopes

docs/RELEASE_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ All notable changes to the [commercetools-project-sync project](https://github.c
3333

3434
This project adheres to [Semantic Versioning](https://semver.org/).
3535

36+
### 5.9.1 - Jan 15, 2026
37+
[Commits](https://github.com/commercetools/commercetools-project-sync/compare/5.9.0...5.9.1)
38+
39+
- 🐞 **Bug Fixes** (1)
40+
- update to use the version 10.5.0 from commercetools-java-sync.
41+
42+
---
43+
3644
### 5.9.0 - Jan 8, 2026
3745
[Commits](https://github.com/commercetools/commercetools-project-sync/compare/5.8.0...5.9.0)
3846

src/test/java/com/commercetools/project/sync/customer/CustomerSyncerTest.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,59 @@ void syncWithWarning_ShouldCallWarningCallback() {
142142
"Customer with key: \"customerKey\" has already a customer number: \"2\", once it's set it cannot be changed. Hereby, the update action is not created.");
143143
}
144144

145+
@Test
146+
void transform_WithAdditionalAddressInfoAndState_ShouldPreserveAddressFields() {
147+
// preparation
148+
final ProjectApiRoot sourceClient = mock(ProjectApiRoot.class);
149+
final CustomerSyncer customerSyncer =
150+
CustomerSyncer.of(sourceClient, mock(ProjectApiRoot.class), mock(Clock.class));
151+
final List<Customer> customers =
152+
Collections.singletonList(
153+
readObjectFromResource("customer-with-state-reference.json", Customer.class));
154+
155+
// test
156+
final CompletionStage<List<CustomerDraft>> draftsFromPageStage =
157+
customerSyncer.transform(customers);
158+
159+
// assertion
160+
final List<CustomerDraft> customerDrafts = draftsFromPageStage.toCompletableFuture().join();
161+
assertThat(customerDrafts).isNotEmpty();
162+
assertThat(customerDrafts.get(0).getAddresses()).isNotEmpty();
163+
assertThat(customerDrafts.get(0).getAddresses().get(0).getState()).isEqualTo("New York");
164+
assertThat(customerDrafts.get(0).getAddresses().get(0).getAdditionalAddressInfo())
165+
.isEqualTo("Building B, Floor 5");
166+
}
167+
168+
@Test
169+
void transform_WithMultipleAddressesWithStateAndAdditionalInfo_ShouldPreserveAllAddressFields() {
170+
// preparation
171+
final ProjectApiRoot sourceClient = mock(ProjectApiRoot.class);
172+
final CustomerSyncer customerSyncer =
173+
CustomerSyncer.of(sourceClient, mock(ProjectApiRoot.class), mock(Clock.class));
174+
final List<Customer> customers =
175+
Collections.singletonList(
176+
readObjectFromResource("customer-with-multiple-addresses.json", Customer.class));
177+
178+
// test
179+
final CompletionStage<List<CustomerDraft>> draftsFromPageStage =
180+
customerSyncer.transform(customers);
181+
182+
// assertion
183+
final List<CustomerDraft> customerDrafts = draftsFromPageStage.toCompletableFuture().join();
184+
assertThat(customerDrafts).isNotEmpty();
185+
assertThat(customerDrafts.get(0).getAddresses()).hasSize(2);
186+
187+
// Verify first address
188+
assertThat(customerDrafts.get(0).getAddresses().get(0).getState()).isEqualTo("California");
189+
assertThat(customerDrafts.get(0).getAddresses().get(0).getAdditionalAddressInfo())
190+
.isEqualTo("Ring doorbell twice");
191+
192+
// Verify second address
193+
assertThat(customerDrafts.get(0).getAddresses().get(1).getState()).isEqualTo("California");
194+
assertThat(customerDrafts.get(0).getAddresses().get(1).getAdditionalAddressInfo())
195+
.isEqualTo("Suite 300, Reception on 3rd floor");
196+
}
197+
145198
private void mockProjectApiRootGetRequest(
146199
final ProjectApiRoot projectApiRoot, final List<Customer> results) {
147200
final ByProjectKeyCustomersRequestBuilder byProjectKeyCustomersRequestBuilder = mock();

src/test/java/com/commercetools/project/sync/shoppinglist/ShoppingListSyncerTest.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,57 @@ void syncWithError_ShouldCallErrorCallback() {
139139
+ ".",
140140
shoppingLists.get(0).getName().toString()));
141141
}
142+
143+
@Test
144+
void transform_WithStoreReference_ShouldReplaceStoreReferenceIdsWithKeys() {
145+
// preparation
146+
final ProjectApiRoot sourceClient = mock(ProjectApiRoot.class);
147+
final ShoppingListSyncer shoppingListSyncer =
148+
ShoppingListSyncer.of(sourceClient, mock(ProjectApiRoot.class), mock(Clock.class));
149+
final List<ShoppingList> shoppingLists =
150+
List.of(readObjectFromResource("shopping-list-with-store.json", ShoppingList.class));
151+
152+
// Mock the store reference resolution
153+
mockResourceIdsGraphQlRequest(sourceClient, "stores", "store-id-456", "store-key-456");
154+
mockResourceIdsGraphQlRequest(
155+
sourceClient, "shoppingLists", "5ebfa80e-f4aa-4c0b-be64-e348e09a855a", "customTypeKey");
156+
157+
// test
158+
final CompletionStage<List<ShoppingListDraft>> draftsFromPageStage =
159+
shoppingListSyncer.transform(shoppingLists);
160+
161+
// assertion
162+
assertThat(draftsFromPageStage)
163+
.isCompletedWithValue(
164+
ShoppingListTransformUtils.toShoppingListDrafts(
165+
sourceClient, referenceIdToKeyCache, shoppingLists)
166+
.join());
167+
}
168+
169+
@Test
170+
void transform_WithMultipleStoreReferences_ShouldResolveAllStoreReferences() {
171+
// preparation
172+
final ProjectApiRoot sourceClient = mock(ProjectApiRoot.class);
173+
final ShoppingListSyncer shoppingListSyncer =
174+
ShoppingListSyncer.of(sourceClient, mock(ProjectApiRoot.class), mock(Clock.class));
175+
final List<ShoppingList> shoppingLists =
176+
List.of(
177+
readObjectFromResource("shopping-list-with-multiple-stores.json", ShoppingList.class));
178+
179+
// Mock multiple store reference resolutions
180+
mockResourceIdsGraphQlRequest(sourceClient, "stores", "store-id-1", "store-key-1");
181+
mockResourceIdsGraphQlRequest(sourceClient, "stores", "store-id-2", "store-key-2");
182+
mockResourceIdsGraphQlRequest(
183+
sourceClient, "shoppingLists", "5ebfa80e-f4aa-4c0b-be64-e348e09a855a", "customTypeKey");
184+
185+
// test
186+
final CompletionStage<List<ShoppingListDraft>> draftsFromPageStage =
187+
shoppingListSyncer.transform(shoppingLists);
188+
189+
// assertion
190+
final List<ShoppingListDraft> shoppingListDrafts =
191+
draftsFromPageStage.toCompletableFuture().join();
192+
assertThat(shoppingListDrafts).isNotEmpty();
193+
assertThat(shoppingListDrafts.get(0).getStore()).isNotNull();
194+
}
142195
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"key": "customerMultipleAddresses",
3+
"customerNumber": "2",
4+
"email": "customer2@example.com",
5+
"firstName": "Jane",
6+
"lastName": "Smith",
7+
"password": "xxx",
8+
"addresses": [
9+
{
10+
"key": "homeAddress",
11+
"id": "addr001",
12+
"firstName": "Jane",
13+
"lastName": "Smith",
14+
"streetName": "Oak Avenue",
15+
"streetNumber": "456",
16+
"postalCode": "67890",
17+
"city": "Los Angeles",
18+
"region": "CA",
19+
"state": "California",
20+
"country": "US",
21+
"additionalAddressInfo": "Ring doorbell twice"
22+
},
23+
{
24+
"key": "officeAddress",
25+
"id": "addr002",
26+
"firstName": "Jane",
27+
"lastName": "Smith",
28+
"streetName": "Business Blvd",
29+
"streetNumber": "789",
30+
"postalCode": "11111",
31+
"city": "San Francisco",
32+
"region": "CA",
33+
"state": "California",
34+
"country": "US",
35+
"additionalAddressInfo": "Suite 300, Reception on 3rd floor"
36+
}
37+
],
38+
"shippingAddressIds": ["addr001"],
39+
"billingAddressIds": ["addr002"],
40+
"isEmailVerified": true,
41+
"stores": []
42+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"key": "customerWithAdditionalAddressInfo",
3+
"customerNumber": "1",
4+
"email": "customer@example.com",
5+
"firstName": "John",
6+
"lastName": "Doe",
7+
"password": "xxx",
8+
"addresses": [
9+
{
10+
"key": "addressKey",
11+
"id": "addr123",
12+
"firstName": "John",
13+
"lastName": "Doe",
14+
"streetName": "Main Street",
15+
"streetNumber": "123",
16+
"postalCode": "12345",
17+
"city": "New York",
18+
"region": "NY",
19+
"state": "New York",
20+
"country": "US",
21+
"additionalAddressInfo": "Building B, Floor 5"
22+
}
23+
],
24+
"shippingAddressIds": [],
25+
"billingAddressIds": [],
26+
"isEmailVerified": false,
27+
"stores": []
28+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"key": "shoppingListMultipleStores",
3+
"slug": {
4+
"en": "shopping-list-multi-store"
5+
},
6+
"name": {
7+
"en": "Shopping List with Multiple Store References"
8+
},
9+
"description": {
10+
"en": "A shopping list with store reference"
11+
},
12+
"store": {
13+
"typeId": "store",
14+
"id": "store-id-1"
15+
},
16+
"customer": {
17+
"typeId": "customer",
18+
"id": "customer-id-789"
19+
},
20+
"lineItems": [
21+
{
22+
"id": "line-item-1",
23+
"productId": "product-id-1",
24+
"name": {
25+
"en": "Product One"
26+
},
27+
"productType": {
28+
"typeId": "product-type",
29+
"id": "product-type-id-1"
30+
},
31+
"variantId": 1,
32+
"quantity": 3,
33+
"addedAt": "2020-10-16T07:52:56.960Z"
34+
},
35+
{
36+
"id": "line-item-2",
37+
"productId": "product-id-2",
38+
"name": {
39+
"en": "Product Two"
40+
},
41+
"productType": {
42+
"typeId": "product-type",
43+
"id": "product-type-id-2"
44+
},
45+
"variantId": 1,
46+
"quantity": 2,
47+
"addedAt": "2020-10-16T08:00:00.000Z"
48+
}
49+
],
50+
"textLineItems": [
51+
{
52+
"id": "text-line-item-1",
53+
"name": {
54+
"en": "Additional Note"
55+
},
56+
"quantity": 1,
57+
"addedAt": "2020-10-16T09:57:12.335Z"
58+
}
59+
],
60+
"custom": {
61+
"type": {
62+
"typeId": "type",
63+
"id": "5ebfa80e-f4aa-4c0b-be64-e348e09a855a"
64+
},
65+
"fields": {
66+
"textField": "multi-store shopping list"
67+
}
68+
}
69+
}

0 commit comments

Comments
 (0)