11package com .commercetools .sync .products .utils ;
22
3+ import static com .commercetools .sync .services .impl .BaseTransformServiceImpl .KEY_IS_NOT_SET_PLACE_HOLDER ;
34import static java .util .Arrays .asList ;
45import static java .util .Collections .singletonList ;
56import static org .assertj .core .api .Assertions .assertThat ;
2526import com .commercetools .sync .commons .utils .ReferenceIdToKeyCache ;
2627import com .commercetools .sync .commons .utils .TestUtils ;
2728import com .commercetools .sync .products .ProductSyncMockUtils ;
28- import com .commercetools .sync .services .impl .BaseTransformServiceImpl ;
2929import com .fasterxml .jackson .core .JsonProcessingException ;
3030import com .fasterxml .jackson .databind .JsonNode ;
3131import com .fasterxml .jackson .databind .ObjectMapper ;
@@ -439,9 +439,9 @@ void transform_ProductReferences_ShouldReplaceReferencesIdsWithKeysAndMapToProdu
439439 .hasValueSatisfying (
440440 productDraft -> {
441441 assertThat (productDraft .getProductType ().getKey ())
442- .isEqualTo (BaseTransformServiceImpl . KEY_IS_NOT_SET_PLACE_HOLDER );
442+ .isEqualTo (KEY_IS_NOT_SET_PLACE_HOLDER );
443443 assertThat (productDraft .getTaxCategory ().getKey ())
444- .isEqualTo (BaseTransformServiceImpl . KEY_IS_NOT_SET_PLACE_HOLDER );
444+ .isEqualTo (KEY_IS_NOT_SET_PLACE_HOLDER );
445445 });
446446 }
447447
@@ -451,9 +451,8 @@ void transform_ProductReferences_ShouldReplaceReferencesIdsWithKeysAndMapToProdu
451451 throws Exception {
452452 // preparation
453453 final ProjectApiRoot sourceClient = mock (ProjectApiRoot .class );
454- referenceIdToKeyCache .add (
455- "cda0dbf7-b42e-40bf-8453-241d5b587f93" ,
456- BaseTransformServiceImpl .KEY_IS_NOT_SET_PLACE_HOLDER );
454+ referenceIdToKeyCache .add ("cda0dbf7-b42e-40bf-8453-241d5b587f93" , KEY_IS_NOT_SET_PLACE_HOLDER );
455+ referenceIdToKeyCache .add ("ebbe95fb-2282-4f9a-8747-fbe440e02dc0" , KEY_IS_NOT_SET_PLACE_HOLDER );
457456 final List <ProductProjection > productPage =
458457 Arrays .asList (
459458 ProductSyncMockUtils .createProductFromJson ("product-with-unresolved-references.json" ));
@@ -482,16 +481,19 @@ void transform_ProductReferences_ShouldReplaceReferencesIdsWithKeysAndMapToProdu
482481 .join ();
483482
484483 // assertions
485-
486484 final Optional <ProductDraft > productKey1 =
487485 productsResolved .stream ()
488486 .filter (productDraft -> "productKeyResolved" .equals (productDraft .getKey ()))
489487 .findFirst ();
490488
491489 assertThat (productKey1 )
492490 .hasValueSatisfying (
493- productDraft ->
494- assertThat (productDraft .getProductType ().getKey ()).isEqualTo ("productTypeKey" ));
491+ productDraft -> {
492+ assertThat (productDraft .getProductType ().getKey ()).isEqualTo ("productTypeKey" );
493+ assertThat (productDraft .getTaxCategory ().getId ())
494+ .isEqualTo ("ebbe95fb-2282-4f9a-8747-fbe440e02dc0" );
495+ assertThat (productDraft .getTaxCategory ().getKey ()).isNull ();
496+ });
495497 }
496498
497499 @ Test
0 commit comments