Skip to content

Commit

Permalink
Update sync-java to newest version (#517)
Browse files Browse the repository at this point in the history
* Update sync-java to newest version

* Update http-client to newest version
  • Loading branch information
lojzatran authored Nov 2, 2023
1 parent 87fb21c commit 37470ba
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 9 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ ext {
assertjVersion = '3.24.2'
pmdVersion = '6.55.0'
jacocoVersion = '0.8.10'
commercetoolsSyncJava = '10.0.0-beta.3'
httpClientVersion = '14.7.0'
commercetoolsSyncJava = '10.0.0-beta.4'
httpClientVersion = '17.0.0'
apacheCliVersion = '1.5.0'
jupiterApiVersion = '5.10.0'
logbackVersion = '1.4.11'
Expand Down Expand Up @@ -65,7 +65,7 @@ tasks.withType(SpotlessTask) {

dependencies {
implementation "com.commercetools:commercetools-sync-java:${commercetoolsSyncJava}"
implementation "com.commercetools.sdk:commercetools-http-client:${httpClientVersion}"
implementation "com.commercetools.sdk:commercetools-okhttp-client4:${httpClientVersion}"
implementation "commons-cli:commons-cli:${apacheCliVersion}"
implementation "ch.qos.logback:logback-classic:${logbackVersion}"
implementation "ch.qos.logback:logback-core:${logbackVersion}"
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/com/commercetools/project/sync/Syncer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import static com.commercetools.project.sync.util.SyncUtils.getSyncModuleName;
import static java.lang.String.format;

import com.commercetools.api.client.PagedQueryResourceRequest;
import com.commercetools.api.client.ProjectApiRoot;
import com.commercetools.api.models.DomainResource;
import com.commercetools.api.models.PagedQueryResourceRequest;
import com.commercetools.api.models.ResourcePagedQueryResponse;
import com.commercetools.api.models.ResourceUpdateAction;
import com.commercetools.api.models.category.Category;
Expand Down Expand Up @@ -45,6 +45,8 @@
* com.commercetools.api.models.product.ProductUpdateAction})
* @param <ResourceDraftT> The type of the resource draft (e.g. {@link ProductDraft}, {@link
* CategoryDraft}, etc..)
* @param <QueryBuilderDslT> The type of the query builder dsl class (e.g. {@link
* com.commercetools.api.predicates.query.state.StateQueryBuilderDsl})
* @param <SyncStatisticsT> The type of the sync statistics resulting from the sync process (e.g.
* {@link com.commercetools.sync.products.helpers.ProductSyncStatistics}, {@link
* com.commercetools.sync.categories.helpers.CategorySyncStatistics}, etc..)
Expand All @@ -62,9 +64,11 @@ public abstract class Syncer<
ResourceT extends BaseResource & DomainResource<ResourceT>,
ResourceUpdateActionT extends ResourceUpdateAction<ResourceUpdateActionT>,
ResourceDraftT,
QueryBuilderDslT,
SyncStatisticsT extends BaseSyncStatistics,
SyncOptionsT extends BaseSyncOptions<ResourceT, ResourceDraftT, ResourceUpdateActionT>,
PagedQueryT extends PagedQueryResourceRequest<PagedQueryT, PagedQueryResponseT>,
PagedQueryT extends
PagedQueryResourceRequest<PagedQueryT, PagedQueryResponseT, QueryBuilderDslT>,
PagedQueryResponseT extends ResourcePagedQueryResponse<ResourceT>,
BaseSyncT extends
BaseSync<ResourceT, ResourceDraftT, ResourceUpdateActionT, SyncStatisticsT, SyncOptionsT>> {
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/com/commercetools/project/sync/SyncerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import static java.lang.String.format;
import static org.apache.commons.lang3.StringUtils.isBlank;

import com.commercetools.api.client.PagedQueryResourceRequest;
import com.commercetools.api.client.ProjectApiRoot;
import com.commercetools.api.models.PagedQueryResourceRequest;
import com.commercetools.api.models.ResourcePagedQueryResponse;
import com.commercetools.api.models.ResourceUpdateAction;
import com.commercetools.api.models.common.BaseResource;
Expand Down Expand Up @@ -131,9 +131,10 @@ private CompletableFuture<Void> chainSyncExecution(
? extends BaseResource,
? extends ResourceUpdateAction<?>,
?,
?,
? extends BaseSyncStatistics,
? extends BaseSyncOptions<?, ?, ?>,
? extends PagedQueryResourceRequest<?, ?>,
? extends PagedQueryResourceRequest<?, ?, ?>,
? extends ResourcePagedQueryResponse<?>,
? extends BaseSync<?, ?, ?, ?, ?>>
syncer =
Expand Down Expand Up @@ -290,9 +291,10 @@ private void closeClients() {
? extends BaseResource,
? extends ResourceUpdateAction<?>,
?,
?,
? extends BaseSyncStatistics,
? extends BaseSyncOptions<?, ?, ?>,
? extends PagedQueryResourceRequest<?, ?>,
? extends PagedQueryResourceRequest<?, ?, ?>,
? extends ResourcePagedQueryResponse<?>,
? extends BaseSync<?, ?, ?, ?, ?>>
buildSyncer(
Expand All @@ -305,9 +307,10 @@ private void closeClients() {
? extends BaseResource,
? extends ResourceUpdateAction<?>,
?,
?,
? extends BaseSyncStatistics,
? extends BaseSyncOptions<?, ?, ?>,
? extends PagedQueryResourceRequest<?, ?>,
? extends PagedQueryResourceRequest<?, ?, ?>,
? extends ResourcePagedQueryResponse<?>,
? extends BaseSync<?, ?, ?, ?, ?>>
syncer = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.commercetools.api.models.cart_discount.CartDiscountDraft;
import com.commercetools.api.models.cart_discount.CartDiscountPagedQueryResponse;
import com.commercetools.api.models.cart_discount.CartDiscountUpdateAction;
import com.commercetools.api.predicates.query.cart_discount.CartDiscountQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -33,6 +34,7 @@ public final class CartDiscountSyncer
CartDiscount,
CartDiscountUpdateAction,
CartDiscountDraft,
CartDiscountQueryBuilderDsl,
CartDiscountSyncStatistics,
CartDiscountSyncOptions,
ByProjectKeyCartDiscountsGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.commercetools.api.models.category.CategoryDraft;
import com.commercetools.api.models.category.CategoryPagedQueryResponse;
import com.commercetools.api.models.category.CategoryUpdateAction;
import com.commercetools.api.predicates.query.category.CategoryQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -33,6 +34,7 @@ public final class CategorySyncer
Category,
CategoryUpdateAction,
CategoryDraft,
CategoryQueryBuilderDsl,
CategorySyncStatistics,
CategorySyncOptions,
ByProjectKeyCategoriesGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.commercetools.api.models.customer.CustomerDraft;
import com.commercetools.api.models.customer.CustomerPagedQueryResponse;
import com.commercetools.api.models.customer.CustomerUpdateAction;
import com.commercetools.api.predicates.query.customer.CustomerQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -33,6 +34,7 @@ public final class CustomerSyncer
Customer,
CustomerUpdateAction,
CustomerDraft,
CustomerQueryBuilderDsl,
CustomerSyncStatistics,
CustomerSyncOptions,
ByProjectKeyCustomersGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.commercetools.api.models.custom_object.CustomObjectDraft;
import com.commercetools.api.models.custom_object.CustomObjectDraftBuilder;
import com.commercetools.api.models.custom_object.CustomObjectPagedQueryResponse;
import com.commercetools.api.predicates.query.custom_object.CustomObjectQueryBuilderDsl;
import com.commercetools.project.sync.SyncModuleOption;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
Expand Down Expand Up @@ -41,6 +42,7 @@ public final class CustomObjectSyncer
CustomObject,
NoopResourceUpdateAction,
CustomObjectDraft,
CustomObjectQueryBuilderDsl,
CustomObjectSyncStatistics,
CustomObjectSyncOptions,
ByProjectKeyCustomObjectsGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.commercetools.api.models.inventory.InventoryEntryDraft;
import com.commercetools.api.models.inventory.InventoryEntryUpdateAction;
import com.commercetools.api.models.inventory.InventoryPagedQueryResponse;
import com.commercetools.api.predicates.query.inventory.InventoryEntryQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -34,6 +35,7 @@ public final class InventoryEntrySyncer
InventoryEntry,
InventoryEntryUpdateAction,
InventoryEntryDraft,
InventoryEntryQueryBuilderDsl,
InventorySyncStatistics,
InventorySyncOptions,
ByProjectKeyInventoryGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.commercetools.api.models.product.ProductUpdateAction;
import com.commercetools.api.models.product.ProductVariantDraft;
import com.commercetools.api.models.product.ProductVariantDraftBuilder;
import com.commercetools.api.predicates.query.product.ProductProjectionQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.model.ProductSyncCustomRequest;
import com.commercetools.project.sync.service.CustomObjectService;
Expand Down Expand Up @@ -46,6 +47,7 @@ public final class ProductSyncer
ProductProjection,
ProductUpdateAction,
ProductDraft,
ProductProjectionQueryBuilderDsl,
ProductSyncStatistics,
ProductSyncOptions,
ByProjectKeyProductProjectionsGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.commercetools.api.models.product_type.ProductTypeDraft;
import com.commercetools.api.models.product_type.ProductTypePagedQueryResponse;
import com.commercetools.api.models.product_type.ProductTypeUpdateAction;
import com.commercetools.api.predicates.query.product_type.ProductTypeQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -33,6 +34,7 @@ public final class ProductTypeSyncer
ProductType,
ProductTypeUpdateAction,
ProductTypeDraft,
ProductTypeQueryBuilderDsl,
ProductTypeSyncStatistics,
ProductTypeSyncOptions,
ByProjectKeyProductTypesGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.commercetools.api.models.shopping_list.ShoppingListDraft;
import com.commercetools.api.models.shopping_list.ShoppingListPagedQueryResponse;
import com.commercetools.api.models.shopping_list.ShoppingListUpdateAction;
import com.commercetools.api.predicates.query.shopping_list.ShoppingListQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -34,6 +35,7 @@ public final class ShoppingListSyncer
ShoppingList,
ShoppingListUpdateAction,
ShoppingListDraft,
ShoppingListQueryBuilderDsl,
ShoppingListSyncStatistics,
ShoppingListSyncOptions,
ByProjectKeyShoppingListsGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.commercetools.api.models.state.StateDraft;
import com.commercetools.api.models.state.StatePagedQueryResponse;
import com.commercetools.api.models.state.StateUpdateAction;
import com.commercetools.api.predicates.query.state.StateQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -34,6 +35,7 @@ public final class StateSyncer
State,
StateUpdateAction,
StateDraft,
StateQueryBuilderDsl,
StateSyncStatistics,
StateSyncOptions,
ByProjectKeyStatesGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.commercetools.api.models.tax_category.TaxRate;
import com.commercetools.api.models.tax_category.TaxRateDraft;
import com.commercetools.api.models.tax_category.TaxRateDraftBuilder;
import com.commercetools.api.predicates.query.tax_category.TaxCategoryQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand All @@ -38,6 +39,7 @@ public final class TaxCategorySyncer
TaxCategory,
TaxCategoryUpdateAction,
TaxCategoryDraft,
TaxCategoryQueryBuilderDsl,
TaxCategorySyncStatistics,
TaxCategorySyncOptions,
ByProjectKeyTaxCategoriesGet,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.commercetools.api.models.type.TypeDraftBuilder;
import com.commercetools.api.models.type.TypePagedQueryResponse;
import com.commercetools.api.models.type.TypeUpdateAction;
import com.commercetools.api.predicates.query.type.TypeQueryBuilderDsl;
import com.commercetools.project.sync.Syncer;
import com.commercetools.project.sync.service.CustomObjectService;
import com.commercetools.project.sync.service.impl.CustomObjectServiceImpl;
Expand Down Expand Up @@ -39,6 +40,7 @@ public final class TypeSyncer
Type,
TypeUpdateAction,
TypeDraft,
TypeQueryBuilderDsl,
TypeSyncStatistics,
TypeSyncOptions,
ByProjectKeyTypesGet,
Expand Down

0 comments on commit 37470ba

Please sign in to comment.