Program: 130817
Project: 130817
Buggy source:
@Test public void orderImportCanOverrideVariantDataInTheOrder() throws Exception {
  final List<AttributeImportDraft> attributeImportDrafts=asList(AttributeImportDraft.of(TShirtProductTypeDraftSupplier.Sizes.ATTRIBUTE.getName(),TShirtProductTypeDraftSupplier.Sizes.S),AttributeImportDraft.of(TShirtProductTypeDraftSupplier.Colors.ATTRIBUTE.getName(),TShirtProductTypeDraftSupplier.Colors.RED));
  final List<Attribute> attributesOfOrder=asList(TShirtProductTypeDraftSupplier.Sizes.ATTRIBUTE.valueOf(TShirtProductTypeDraftSupplier.Sizes.S),TShirtProductTypeDraftSupplier.Colors.ATTRIBUTE.valueOf(TShirtProductTypeDraftSupplier.Colors.RED));
  final List<Image> images=asList(Image.of("String_Node_Str",ImageDimensions.of(1,2),"String_Node_Str"));
  final List<Price> prices=asList(Price.of(new BigDecimal("String_Node_Str"),DefaultCurrencyUnits.EUR));
  withProduct(client(),product -> {
    final int variantId=1;
    final ProductVariantImportDraft productVariantImportDraft=ProductVariantImportDraftBuilder.of(product.getId(),variantId,sku(product)).attributes(attributeImportDrafts).images(images).prices(prices).build();
    final Price price=PRICE;
    final LocalizedString name=randomSlug();
    final LineItemImportDraft lineItemImportDraft=LineItemImportDraftBuilder.of(productVariantImportDraft,2L,price,name).build();
    testOrderAspect(builder -> builder.lineItems(asList(lineItemImportDraft)),order -> {
      final LineItem lineItem=order.getLineItems().get(0);
      final ProductVariant masterVariant=product.getMasterData().getStaged().getMasterVariant();
      final ProductVariant productVariant=lineItem.getVariant();
      assertThat(productVariant.getAttributes()).isEqualTo(attributesOfOrder).isNotEqualTo(masterVariant.getAttributes());
      assertThat(productVariant.getImages()).isEqualTo(images).isNotEqualTo(masterVariant.getImages());
    }
);
  }
);
}

Fixed version (ground truth):
@Test public void orderImportCanOverrideVariantDataInTheOrder() throws Exception {
  final List<AttributeImportDraft> attributeImportDrafts=asList(AttributeImportDraft.of(TShirtProductTypeDraftSupplier.Sizes.ATTRIBUTE.getName(),TShirtProductTypeDraftSupplier.Sizes.S),AttributeImportDraft.of(TShirtProductTypeDraftSupplier.Colors.ATTRIBUTE.getName(),TShirtProductTypeDraftSupplier.Colors.RED));
  final List<Attribute> attributesOfOrder=asList(TShirtProductTypeDraftSupplier.Sizes.ATTRIBUTE.valueOf(TShirtProductTypeDraftSupplier.Sizes.S),TShirtProductTypeDraftSupplier.Colors.ATTRIBUTE.valueOf(TShirtProductTypeDraftSupplier.Colors.RED));
  final List<Image> images=asList(Image.of("String_Node_Str",ImageDimensions.of(1,2),"String_Node_Str"));
  final List<PriceDraft> prices=asList(PriceDraft.of(new BigDecimal("String_Node_Str"),DefaultCurrencyUnits.EUR));
  withProduct(client(),product -> {
    final int variantId=1;
    final ProductVariantImportDraft productVariantImportDraft=ProductVariantImportDraftBuilder.of(product.getId(),variantId,sku(product)).attributes(attributeImportDrafts).images(images).prices(prices).build();
    final Price price=PRICE;
    final LocalizedString name=randomSlug();
    final LineItemImportDraft lineItemImportDraft=LineItemImportDraftBuilder.of(productVariantImportDraft,2L,price,name).build();
    testOrderAspect(builder -> builder.lineItems(asList(lineItemImportDraft)),order -> {
      final LineItem lineItem=order.getLineItems().get(0);
      final ProductVariant masterVariant=product.getMasterData().getStaged().getMasterVariant();
      final ProductVariant productVariant=lineItem.getVariant();
      assertThat(productVariant.getAttributes()).isEqualTo(attributesOfOrder).isNotEqualTo(masterVariant.getAttributes());
      assertThat(productVariant.getImages()).isEqualTo(images).isNotEqualTo(masterVariant.getImages());
      assertEqualPrices(productVariant.getPrices(),prices);
    }
);
  }
);
}