// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/order/ProductId.java
// public class ProductId extends GenericId {
// 
//   public ProductId(@JsonProperty("id") String id) {
//     super(id);
//   }
// 
//   public static ProductId randomId() {
//     return new ProductId(UUID.randomUUID().toString());
//   }
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/PublisherContractId.java
// public class PublisherContractId extends GenericId {
// 
//   public PublisherContractId(@JsonProperty("id") String id) {
//     super(id);
//   }
// 
//   public static PublisherContractId randomId() {
//     return new PublisherContractId(UUID.randomUUID().toString());
//   }
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/event/PublisherContractRegisteredEvent.java
// public class PublisherContractRegisteredEvent extends DomainEvent<PublisherContractId> {
// 
//   public final String publisherName;
//   public final double feePercentage;
//   public final long limit;
// 
//   public PublisherContractRegisteredEvent(@JsonProperty("aggregateId") PublisherContractId aggregateId,
//                                           @JsonProperty("version") int version,
//                                           @JsonProperty("timestamp") long timestamp,
//                                           @JsonProperty("publisherName") String publisherName,
//                                           @JsonProperty("feePercentage") double feePercentage,
//                                           @JsonProperty("limit") long limit) {
//     super(aggregateId, version, timestamp);
//     this.publisherName = publisherName;
//     this.feePercentage = feePercentage;
//     this.limit = limit;
//   }
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/event/PurchaseRegisteredEvent.java
// public class PurchaseRegisteredEvent extends DomainEvent<PublisherContractId> {
// 
//   public final ProductId productId;
//   public final long purchaseAmount;
//   public final long feeAmount;
//   public final long accumulatedFee;
// 
//   public PurchaseRegisteredEvent(@JsonProperty("aggregateId") PublisherContractId aggregateId,
//                                  @JsonProperty("version") int version,
//                                  @JsonProperty("timestamp") long timestamp,
//                                  @JsonProperty("productId") ProductId productId,
//                                  @JsonProperty("purchaseAmount") long purchaseAmount,
//                                  @JsonProperty("feeAmount") long feeAmount,
//                                  @JsonProperty("accumulatedFee") long accumulatedFee) {
//     super(aggregateId, version, timestamp);
//     this.productId = productId;
//     this.purchaseAmount = purchaseAmount;
//     this.feeAmount = feeAmount;
//     this.accumulatedFee = accumulatedFee;
//   }
// 
// }


import org.junit.Test;
import se.citerus.cqrs.bookstore.ordercontext.order.ProductId;
import se.citerus.cqrs.bookstore.ordercontext.publishercontract.PublisherContractId;
import se.citerus.cqrs.bookstore.ordercontext.publishercontract.event.PublisherContractRegisteredEvent;
import se.citerus.cqrs.bookstore.ordercontext.publishercontract.event.PurchaseRegisteredEvent;
import java.util.Iterator;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.getOnlyElement;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
package se.citerus.cqrs.bookstore.ordercontext.publishercontract.domain;




public class PublisherContractTest {

  private static final long LIMIT = 100_000;

  @Test
  public void testRegisterPublisher() {
    PublisherContract contract = new PublisherContract();
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/order/ProductId.java
// public class ProductId extends GenericId {
// 
//   public ProductId(@JsonProperty("id") String id) {
//     super(id);
//   }
// 
//   public static ProductId randomId() {
//     return new ProductId(UUID.randomUUID().toString());
//   }
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/PublisherContractId.java
// public class PublisherContractId extends GenericId {
// 
//   public PublisherContractId(@JsonProperty("id") String id) {
//     super(id);
//   }
// 
//   public static PublisherContractId randomId() {
//     return new PublisherContractId(UUID.randomUUID().toString());
//   }
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/event/PublisherContractRegisteredEvent.java
// public class PublisherContractRegisteredEvent extends DomainEvent<PublisherContractId> {
// 
//   public final String publisherName;
//   public final double feePercentage;
//   public final long limit;
// 
//   public PublisherContractRegisteredEvent(@JsonProperty("aggregateId") PublisherContractId aggregateId,
//                                           @JsonProperty("version") int version,
//                                           @JsonProperty("timestamp") long timestamp,
//                                           @JsonProperty("publisherName") String publisherName,
//                                           @JsonProperty("feePercentage") double feePercentage,
//                                           @JsonProperty("limit") long limit) {
//     super(aggregateId, version, timestamp);
//     this.publisherName = publisherName;
//     this.feePercentage = feePercentage;
//     this.limit = limit;
//   }
// 
// }
// 
// Path: order-context-parent/eventbus-contract/src/main/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/event/PurchaseRegisteredEvent.java
// public class PurchaseRegisteredEvent extends DomainEvent<PublisherContractId> {
// 
//   public final ProductId productId;
//   public final long purchaseAmount;
//   public final long feeAmount;
//   public final long accumulatedFee;
// 
//   public PurchaseRegisteredEvent(@JsonProperty("aggregateId") PublisherContractId aggregateId,
//                                  @JsonProperty("version") int version,
//                                  @JsonProperty("timestamp") long timestamp,
//                                  @JsonProperty("productId") ProductId productId,
//                                  @JsonProperty("purchaseAmount") long purchaseAmount,
//                                  @JsonProperty("feeAmount") long feeAmount,
//                                  @JsonProperty("accumulatedFee") long accumulatedFee) {
//     super(aggregateId, version, timestamp);
//     this.productId = productId;
//     this.purchaseAmount = purchaseAmount;
//     this.feeAmount = feeAmount;
//     this.accumulatedFee = accumulatedFee;
//   }
// 
// }


// Path: order-context-parent/publisher-contract-command/src/test/java/se/citerus/cqrs/bookstore/ordercontext/publishercontract/domain/PublisherContractTest.java
import org.junit.Test;
import se.citerus.cqrs.bookstore.ordercontext.order.ProductId;
import se.citerus.cqrs.bookstore.ordercontext.publishercontract.PublisherContractId;
import se.citerus.cqrs.bookstore.ordercontext.publishercontract.event.PublisherContractRegisteredEvent;
import se.citerus.cqrs.bookstore.ordercontext.publishercontract.event.PurchaseRegisteredEvent;
import java.util.Iterator;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.getOnlyElement;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

package se.citerus.cqrs.bookstore.ordercontext.publishercontract.domain;




public class PublisherContractTest {

  private static final long LIMIT = 100_000;

  @Test
  public void testRegisterPublisher() {
    PublisherContract contract = new PublisherContract();
    PublisherContractId publisherContractId = PublisherContractId.randomId();