@Test public void setImageLabel() throws Exception { withProductWithImages(client(), Arrays.asList(URL_1), (Product product) -> { final String changeToImageLabel = "New image label"; final ProductUpdateCommand updateCommand = ProductUpdateCommand.of(product, SetImageLabel.of(1, URL_1, changeToImageLabel, null)); final Product updatedProduct = client().executeBlocking(updateCommand); final Optional<Image> changedImage = updatedProduct.getMasterData().getStaged().getMasterVariant().getImages() .stream() .findFirst(); assertThat(changedImage).isPresent(); final String updatedImageLabel = changedImage.get().getLabel(); assertThat(updatedImageLabel).isEqualTo(changeToImageLabel); return updatedProduct; }); }