// Path: warehouse-model/src/main/java/warehouse/BoxLabel.java
// @Value
// public class BoxLabel {
//     private final String refNo;
//     private final int quantity;
//     private final String boxType;
// }
// 
// Path: warehouse-model/src/main/java/warehouse/PaletteLabel.java
// @Value
// public class PaletteLabel {
//     private final String id;
//     private final String refNo;
// 
//     @Override
//     public String toString() {
//         return id;
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/TLabelsFormats.java
// public class TLabelsFormats implements Labels {
// 
//     private final AtomicInteger index;
// 
//     public TLabelsFormats(int lastIndex) {
//         this.index = new AtomicInteger(lastIndex);
//     }
// 
//     @Override
//     public PaletteLabel newPalette(String refNo) {
//         String suffix = String.format("%04X", index.getAndIncrement());
//         return new PaletteLabel("P-" + refNo + "-" + suffix, refNo);
//     }
// 
//     @Override
//     public PaletteLabel scanPalette(String label) {
//         String[] pieces = label.split("-");
//         if (!label.startsWith("P-")) {
//             throw new IllegalArgumentException("Label need to start with 'P-' characters, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         if (pieces.length != 3) {
//             throw new IllegalArgumentException("Label need to have two '-' characters, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         if (pieces[1].isEmpty()) {
//             throw new IllegalArgumentException("Label has empty refNo, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         if (pieces[2].isEmpty()) {
//             throw new IllegalArgumentException("Label has empty index, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         return new PaletteLabel(label, pieces[1]);
//     }
// 
//     @Override
//     public BoxLabel scanBox(String label) {
//         String[] pieces = label.split("-");
//         if (!label.startsWith("B-")) {
//             throw new IllegalArgumentException("Label need to start with 'B-' characters, format: B-<refNo>-<quantity>-<boxType>, ex: B-900300-24-B");
//         }
//         if (pieces.length != 4) {
//             throw new IllegalArgumentException("Label need to have three '-' characters, format: B-<refNo>-<quantity>-<boxType>, ex: B-900300-24-B");
//         }
//         return new BoxLabel(pieces[1], Integer.valueOf(pieces[2]), pieces[3]);
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/locations/Location.java
// @Value
// public class Location {
//     private final String location;
// 
//     public static Location production() {
//         return new Location("production");
//     }
// 
//     public static Location quarantine() {
//         return new Location("quarantine");
//     }
// 
//     public static Location onTheMove(String user) {
//         return new Location("picked by " + user);
//     }
// 
//     public static Location unknown() {
//         return new Location("<unknown>");
//     }
// }
// 
// Path: warehouse-model/src/test/java/warehouse/products/ProductStockBuilder.java
// public static RefNoLocation l(String refNo, Location location) {
//     return new RefNoLocation(refNo, location);
// }


import cucumber.api.PendingException;
import cucumber.api.java.Before;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.assertj.core.api.Assertions;
import warehouse.BoxLabel;
import warehouse.PaletteLabel;
import warehouse.TLabelsFormats;
import warehouse.locations.Location;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static warehouse.products.ProductStockBuilder.l;
package warehouse.products;




/**
 * Created by michal on 08.06.2016.
 */
public class RegistrationAndStoringSteps {

    private PaletteLabel paletteLabel;
    private List<BoxLabel> scannedBoxes = new ArrayList<>();

    private ProductStock object;
    private EventsAssert events = new EventsAssert();
    private TLabelsFormats generator = new TLabelsFormats(0);

    @Before
    public void setUp() throws Exception {
        object = ProductStockBuilder.forRefNo("900300")
// Path: warehouse-model/src/main/java/warehouse/BoxLabel.java
// @Value
// public class BoxLabel {
//     private final String refNo;
//     private final int quantity;
//     private final String boxType;
// }
// 
// Path: warehouse-model/src/main/java/warehouse/PaletteLabel.java
// @Value
// public class PaletteLabel {
//     private final String id;
//     private final String refNo;
// 
//     @Override
//     public String toString() {
//         return id;
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/TLabelsFormats.java
// public class TLabelsFormats implements Labels {
// 
//     private final AtomicInteger index;
// 
//     public TLabelsFormats(int lastIndex) {
//         this.index = new AtomicInteger(lastIndex);
//     }
// 
//     @Override
//     public PaletteLabel newPalette(String refNo) {
//         String suffix = String.format("%04X", index.getAndIncrement());
//         return new PaletteLabel("P-" + refNo + "-" + suffix, refNo);
//     }
// 
//     @Override
//     public PaletteLabel scanPalette(String label) {
//         String[] pieces = label.split("-");
//         if (!label.startsWith("P-")) {
//             throw new IllegalArgumentException("Label need to start with 'P-' characters, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         if (pieces.length != 3) {
//             throw new IllegalArgumentException("Label need to have two '-' characters, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         if (pieces[1].isEmpty()) {
//             throw new IllegalArgumentException("Label has empty refNo, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         if (pieces[2].isEmpty()) {
//             throw new IllegalArgumentException("Label has empty index, format: P-<refNo>-<index>, ex: P-900300-8A3");
//         }
//         return new PaletteLabel(label, pieces[1]);
//     }
// 
//     @Override
//     public BoxLabel scanBox(String label) {
//         String[] pieces = label.split("-");
//         if (!label.startsWith("B-")) {
//             throw new IllegalArgumentException("Label need to start with 'B-' characters, format: B-<refNo>-<quantity>-<boxType>, ex: B-900300-24-B");
//         }
//         if (pieces.length != 4) {
//             throw new IllegalArgumentException("Label need to have three '-' characters, format: B-<refNo>-<quantity>-<boxType>, ex: B-900300-24-B");
//         }
//         return new BoxLabel(pieces[1], Integer.valueOf(pieces[2]), pieces[3]);
//     }
// }
// 
// Path: warehouse-model/src/main/java/warehouse/locations/Location.java
// @Value
// public class Location {
//     private final String location;
// 
//     public static Location production() {
//         return new Location("production");
//     }
// 
//     public static Location quarantine() {
//         return new Location("quarantine");
//     }
// 
//     public static Location onTheMove(String user) {
//         return new Location("picked by " + user);
//     }
// 
//     public static Location unknown() {
//         return new Location("<unknown>");
//     }
// }
// 
// Path: warehouse-model/src/test/java/warehouse/products/ProductStockBuilder.java
// public static RefNoLocation l(String refNo, Location location) {
//     return new RefNoLocation(refNo, location);
// }


// Path: warehouse-model/src/test/java/warehouse/products/RegistrationAndStoringSteps.java
import cucumber.api.PendingException;
import cucumber.api.java.Before;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.assertj.core.api.Assertions;
import warehouse.BoxLabel;
import warehouse.PaletteLabel;
import warehouse.TLabelsFormats;
import warehouse.locations.Location;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static warehouse.products.ProductStockBuilder.l;

package warehouse.products;




/**
 * Created by michal on 08.06.2016.
 */
public class RegistrationAndStoringSteps {

    private PaletteLabel paletteLabel;
    private List<BoxLabel> scannedBoxes = new ArrayList<>();

    private ProductStock object;
    private EventsAssert events = new EventsAssert();
    private TLabelsFormats generator = new TLabelsFormats(0);

    @Before
    public void setUp() throws Exception {
        object = ProductStockBuilder.forRefNo("900300")
                .locationsPicker(l("900300", new Location("A-32-3")))