Skip to content

Commit

Permalink
Migrate product syncer with unittests (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
salander85 authored Oct 26, 2023
1 parent e2bca8a commit f8230e3
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// This class compiles but not tested yet
// TODO: Test class and adjust logic if needed
public final class ProductSyncer
extends Syncer<
ProductProjection,
Expand Down Expand Up @@ -184,16 +182,16 @@ private static Throwable getCompletionExceptionCause(@Nonnull final Throwable ex
@Nonnull
@Override
protected ByProjectKeyProductProjectionsGet getQuery() {
final ByProjectKeyProductProjectionsGet productProjectionsGet =
ByProjectKeyProductProjectionsGet productProjectionsGet =
getSourceClient().productProjections().get().addStaged(true);
if (productSyncCustomRequest == null) {
return productProjectionsGet;
}
if (null != productSyncCustomRequest.getLimit()) {
productProjectionsGet.withLimit(productSyncCustomRequest.getLimit());
productProjectionsGet = productProjectionsGet.withLimit(productSyncCustomRequest.getLimit());
}
if (null != productSyncCustomRequest.getWhere()) {
productProjectionsGet.withWhere(productSyncCustomRequest.getWhere());
productProjectionsGet = productProjectionsGet.withWhere(productSyncCustomRequest.getWhere());
}

return productProjectionsGet;
Expand Down
Loading

0 comments on commit f8230e3

Please sign in to comment.