@Nullable @Override public LocalizedString getMetaDescription() { return delegate.getMetaDescription(); }
@Nullable @Override public LocalizedString getMetaDescription() { return delegate.getMetaDescription(); }
@Nullable @Override public LocalizedString getMetaDescription() { return delegate.getMetaDescription(); }
@Test public void setMetaDescription() throws Exception { withPersistentCategory(client(), category -> { final LocalizedString newValue = randomSlug(); final Category updatedCategory = client().executeBlocking(CategoryUpdateCommand.of(category, SetMetaDescription.of(newValue))); assertThat(updatedCategory.getMetaDescription()).isEqualTo(newValue); }); }
@Test public void execution() throws Exception { final LocalizedString name = LocalizedString.of(Locale.ENGLISH, "winter clothing"); final LocalizedString slug = name.slugifiedUnique(); final String externalId = randomKey(); final LocalizedString metaDescription = LocalizedString.of(Locale.ENGLISH, "winter clothing to keep you warm"); final LocalizedString metaTitle = LocalizedString.of(Locale.ENGLISH, "winter warm clothing"); final LocalizedString metaKeywords = LocalizedString.of(Locale.ENGLISH, "winter,clothes"); final CategoryDraft categoryDraft = CategoryDraftBuilder.of(name, slug) .metaDescription(metaDescription) .metaTitle(metaTitle) .metaKeywords(metaKeywords) .externalId(externalId).build(); final Category category = client().executeBlocking(CategoryCreateCommand.of(categoryDraft)); assertThat(category.getName()).isEqualTo(name); assertThat(category.getSlug()).isEqualTo(slug); assertThat(category.getMetaTitle()).isEqualTo(metaTitle); assertThat(category.getMetaDescription()).isEqualTo(metaDescription); assertThat(category.getMetaKeywords()).isEqualTo(metaKeywords); assertThat(category.getExternalId()).contains(externalId); }
/** * Creates a new object initialized with the fields of the template parameter. * * @param template the template * @return a new object initialized from the template */ public static CategoryDraftBuilder of(final Category template) { return new CategoryDraftBuilder(copyAssets(template.getAssets()), copyCustom(template.getCustom()), template.getDescription(), template.getExternalId(), template.getKey(), template.getMetaDescription(), template.getMetaKeywords(), template.getMetaTitle(), template.getName(), template.getOrderHint(), template.getParent(), template.getSlug()); } }