public static SetSearchKeywords of(final SearchKeywords searchKeywords, final ProductUpdateScope productUpdateScope) { return new SetSearchKeywords(searchKeywords, productUpdateScope); } }
public static SetSearchKeywords of(final SearchKeywords searchKeywords) { return of(searchKeywords, null); }
public static SetSearchKeywords of(final SearchKeywords searchKeywords) { return new SetSearchKeywords(searchKeywords); } }
public static SetSearchKeywords of(final SearchKeywords searchKeywords) { return of(searchKeywords, null); }
public static SetSearchKeywords of(final SearchKeywords searchKeywords, @Nullable final Boolean staged) { return new SetSearchKeywords(searchKeywords, staged); } }
public void setSearchKeywordsWithStaged(final Boolean staged) { withUpdateableProduct(client(), product -> { assertThat(product.getMasterData().hasStagedChanges()).isFalse(); final SearchKeywords searchKeywords = SearchKeywords.of(Locale.ENGLISH, asList(SearchKeyword.of("Raider", CustomSuggestTokenizer.of(singletonList("Twix"))))); final ProductUpdateCommand command = ProductUpdateCommand.of(product, SetSearchKeywords.of(searchKeywords, staged)); final Product updatedProduct = client().executeBlocking(command); final SearchKeywords actualKeywords = updatedProduct.getMasterData().getStaged().getSearchKeywords(); assertThat(actualKeywords).isEqualTo(searchKeywords); assertThat(updatedProduct.getMasterData().hasStagedChanges()).isEqualTo(staged); return updatedProduct; }); }
public static SetSearchKeywords of(final SearchKeywords searchKeywords, @Nullable final Boolean staged) { return new SetSearchKeywords(searchKeywords, staged); } }
@Test public void setSearchKeywords() throws Exception { withUpdateableProduct(client(), product -> { assertThat(product.getMasterData().hasStagedChanges()).isFalse(); final SearchKeywords searchKeywords = SearchKeywords.of(Locale.ENGLISH, asList(SearchKeyword.of("Raider", CustomSuggestTokenizer.of(singletonList("Twix"))))); final ProductUpdateCommand command = ProductUpdateCommand.of(product, SetSearchKeywords.of(searchKeywords)); final Product updatedProduct = client().executeBlocking(command); final SearchKeywords actualKeywords = updatedProduct.getMasterData().getStaged().getSearchKeywords(); assertThat(actualKeywords).isEqualTo(searchKeywords); assertThat(updatedProduct.getMasterData().hasStagedChanges()).isTrue(); return updatedProduct; }); }