@@ -0,0 +1,3221 @@
+/*%0A * Copyright 2017, TeamDev Ltd. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage org.spine3.server.entity;%0A%0Aimport com.google.protobuf.StringValue;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.spine3.server.BoundedContext;%0Aimport org.spine3.server.aggregate.AggregatePart;%0Aimport org.spine3.server.aggregate.AggregateRoot;%0A%0Aimport java.lang.reflect.Constructor;%0A%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.spine3.base.Identifiers.newUuid;%0A%0A/**%0A * @author Illia Shepilov%0A */%0Apublic class AbstractEntityShould %7B%0A%0A    private BoundedContext boundedContext;%0A    private AnAggregateRoot root;%0A    private String id;%0A%0A    @Before%0A    public void setUp() %7B%0A        boundedContext = BoundedContext.newBuilder()%0A                                       .build();%0A        id = newUuid();%0A        root = new AnAggregateRoot(boundedContext, id);%0A    %7D%0A%0A    @Test%0A    public void create_aggregate_part_entity() throws NoSuchMethodException %7B%0A        final Constructor%3CAnAggregatePart%3E constructor =%0A                AnAggregatePart.class.getDeclaredConstructor(String.class, AnAggregateRoot.class);%0A        final AggregatePart aggregatePart =%0A                AbstractEntity.createAggregatePartEntity(constructor, id, root);%0A        assertNotNull(aggregatePart);%0A    %7D%0A%0A    @Test%0A    public void create_aggregate_root_entity()%7B%0A        final AnAggregateRoot aggregateRoot =%0A                AbstractEntity.createAggregateRootEntity(id, boundedContext, AnAggregateRoot.class);%0A        assertNotNull(aggregateRoot);%0A    %7D%0A%0A    static class AnAggregatePart extends AggregatePart%3CString, StringValue, StringValue.Builder%3E %7B%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         *%0A         * @param id%0A         * @param root%0A         */%0A        protected AnAggregatePart(String id, AnAggregateRoot root) %7B%0A            super(id, root);%0A        %7D%0A    %7D%0A%0A    private static class AnAggregateRoot extends AggregateRoot%3CString%3E %7B%0A        /**%0A         * Creates an new instance.%0A         *%0A         * @param boundedContext the bounded context to which the aggregate belongs%0A         * @param id             the ID of the aggregate%0A         */%0A        protected AnAggregateRoot(BoundedContext boundedContext, String id) %7B%0A            super(boundedContext, id);%0A        %7D%0A    %7D%0A%7D%0A

Add tests for the `AbstractEntity` class.