public static RevertStagedChanges of() { return new RevertStagedChanges(); } }
@Test public void revertStagedChanges() throws Exception { withUpdateableProduct(client(), product -> { //changing only staged and not current final LocalizedString oldDescriptionOption = product.getMasterData().getStaged().getDescription(); final LocalizedString newDescription = LocalizedString.ofEnglish("new description " + RANDOM.nextInt()); final ProductUpdateCommand cmd = ProductUpdateCommand.of(product, asList(Publish.of(), SetDescription.of(newDescription))); final Product updatedProduct = client().executeBlocking(cmd); assertThat(oldDescriptionOption).isNotEqualTo(newDescription); assertThat(updatedProduct.getMasterData().getStaged().getDescription()).isEqualTo(newDescription); assertThat(updatedProduct.getMasterData().getCurrent().getDescription()).isEqualTo(oldDescriptionOption); final Product revertedProduct = client().executeBlocking(ProductUpdateCommand.of(updatedProduct, RevertStagedChanges.of())); assertThat(revertedProduct.getMasterData().getStaged().getDescription()).isEqualTo(oldDescriptionOption); assertThat(revertedProduct.getMasterData().getCurrent().getDescription()).isEqualTo(oldDescriptionOption); return revertedProduct; }); }
final Product updatedProduct = client().executeBlocking(cmd); final Product revertedProduct = client().executeBlocking(ProductUpdateCommand.of(updatedProduct, RevertStagedChanges.of()));
public static RevertStagedChanges of() { return new RevertStagedChanges(); } }
public static RevertStagedChanges of() { return new RevertStagedChanges(); } }
public static RevertStagedChanges of() { return new RevertStagedChanges(); } }