// Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public static final EntityType TYPE = new StringBasedEntityType("A");
// 
//     private final long id;
// 
//     public AId(final long id) {
//         this.id = id;
//     }
// 
//     @Override
//     public EntityType getType() {
//         return TYPE;
//     }
// 
//     @Override
//     public String asString() {
//         return "" + id;
//     }
// 
//     @Override
//     public String asTypedString() {
//         return getType() + " " + asString();
//     }
// 
//     @Override
//     public String toString() {
//         return "AId [id=" + id + "]";
//     }
// 
// }


import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import org.fuin.ddd4j.test.AId;
import org.fuin.objects4j.common.ConstraintViolationException;
import org.junit.Test;


        // TEST & VERIFY

        testee.requireArgValid("a", null);
        testee.requireArgValid("x", "A 1");

        try {
            testee.requireArgValid("a", "X 1");
            fail("Expected exception");
        } catch (final ConstraintViolationException ex) {
            assertThat(ex.getMessage()).isEqualTo("The argument 'a' is not valid: 'X 1'");
        }

        try {
            testee.requireArgValid("a", "");
            fail("Expected exception");
        } catch (final ConstraintViolationException ex) {
            assertThat(ex.getMessage()).isEqualTo("The argument 'a' is not valid: ''");
        }

    }

    @Test
    public void testToVO() {

        // PREPARE
        final EntityIdConverter testee = new EntityIdConverter(new MyIdFactory());
        final EntityId entityId = testee.toVO("A 1");

        // TEST & VERIFY

// Path: src/test/java/org/fuin/ddd4j/test/AId.java
// public class AId implements ImplRootId {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public static final EntityType TYPE = new StringBasedEntityType("A");
// 
//     private final long id;
// 
//     public AId(final long id) {
//         this.id = id;
//     }
// 
//     @Override
//     public EntityType getType() {
//         return TYPE;
//     }
// 
//     @Override
//     public String asString() {
//         return "" + id;
//     }
// 
//     @Override
//     public String asTypedString() {
//         return getType() + " " + asString();
//     }
// 
//     @Override
//     public String toString() {
//         return "AId [id=" + id + "]";
//     }
// 
// }


// Path: src/test/java/org/fuin/ddd4j/ddd/EntityIdConverterTest.java
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import org.fuin.ddd4j.test.AId;
import org.fuin.objects4j.common.ConstraintViolationException;
import org.junit.Test;


        // TEST & VERIFY

        testee.requireArgValid("a", null);
        testee.requireArgValid("x", "A 1");

        try {
            testee.requireArgValid("a", "X 1");
            fail("Expected exception");
        } catch (final ConstraintViolationException ex) {
            assertThat(ex.getMessage()).isEqualTo("The argument 'a' is not valid: 'X 1'");
        }

        try {
            testee.requireArgValid("a", "");
            fail("Expected exception");
        } catch (final ConstraintViolationException ex) {
            assertThat(ex.getMessage()).isEqualTo("The argument 'a' is not valid: ''");
        }

    }

    @Test
    public void testToVO() {

        // PREPARE
        final EntityIdConverter testee = new EntityIdConverter(new MyIdFactory());
        final EntityId entityId = testee.toVO("A 1");

        // TEST & VERIFY

        assertThat(entityId).isInstanceOf(AId.class);
