// Path: myeslib-core/src/main/java/org/myeslib/core/Command.java
// public interface Command extends Serializable {
// 	
//     UUID getCommandId();
// 	Long getTargetVersion();
// 	
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/Event.java
// public interface Event extends Serializable {
// 	
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/data/test/CommandJustForTest.java
// @SuppressWarnings("serial")
// @Value
// public class CommandJustForTest implements Command{
//     UUID commandId;
// 	UUID id;
// 	Long targetVersion;
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/data/test/EventJustForTest.java
// @SuppressWarnings("serial")
// @Value
// public class EventJustForTest implements Event {
// 	UUID id;
// 	int something;
// }


import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.emptyCollectionOf;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.UUID;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.myeslib.core.Command;
import org.myeslib.core.Event;
import org.myeslib.core.data.test.CommandJustForTest;
import org.myeslib.core.data.test.EventJustForTest;
package org.myeslib.core.data;




@RunWith(MockitoJUnitRunner.class)
public class AggregateRootHistoryTest {

    @Test
    public void empty() {
        AggregateRootHistory transactions = new AggregateRootHistory();
        assertThat(transactions.getLastVersion(), is(new Long(0)));
        assertThat(transactions.getAllEvents().size(), is(0));
    }

    @Test(expected = NullPointerException.class)
    public void nullCommand() {
        AggregateRootHistory transactions = new AggregateRootHistory();
// Path: myeslib-core/src/main/java/org/myeslib/core/Command.java
// public interface Command extends Serializable {
// 	
//     UUID getCommandId();
// 	Long getTargetVersion();
// 	
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/Event.java
// public interface Event extends Serializable {
// 	
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/data/test/CommandJustForTest.java
// @SuppressWarnings("serial")
// @Value
// public class CommandJustForTest implements Command{
//     UUID commandId;
// 	UUID id;
// 	Long targetVersion;
// }
// 
// Path: myeslib-core/src/main/java/org/myeslib/core/data/test/EventJustForTest.java
// @SuppressWarnings("serial")
// @Value
// public class EventJustForTest implements Event {
// 	UUID id;
// 	int something;
// }


// Path: myeslib-core/src/test/java/org/myeslib/core/data/AggregateRootHistoryTest.java
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsEmptyCollection.emptyCollectionOf;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.UUID;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.myeslib.core.Command;
import org.myeslib.core.Event;
import org.myeslib.core.data.test.CommandJustForTest;
import org.myeslib.core.data.test.EventJustForTest;

package org.myeslib.core.data;




@RunWith(MockitoJUnitRunner.class)
public class AggregateRootHistoryTest {

    @Test
    public void empty() {
        AggregateRootHistory transactions = new AggregateRootHistory();
        assertThat(transactions.getLastVersion(), is(new Long(0)));
        assertThat(transactions.getAllEvents().size(), is(0));
    }

    @Test(expected = NullPointerException.class)
    public void nullCommand() {
        AggregateRootHistory transactions = new AggregateRootHistory();
        transactions.add(UnitOfWork.create(UUID.randomUUID(), null, Arrays.asList(Mockito.mock(Event.class))));