@@ -0,0 +1,2807 @@
+/*%0A * Copyright 2015, 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;%0A%0Aimport com.google.protobuf.Message;%0Aimport com.google.protobuf.Timestamp;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.spine3.base.CommandRequest;%0Aimport org.spine3.base.EventRecord;%0A%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.assertNotNull;%0A%0A@SuppressWarnings(%7B%22InstanceMethodNamingConvention%22, %22ResultOfObjectAllocationIgnored%22, %22MagicNumber%22,%0A%22ClassWithTooManyMethods%22, %22ReturnOfNull%22, %22ConstantConditions%22%7D)%0Apublic class EngineShould %7B%0A%0A    @Before%0A    public void setUp() %7B%0A        Engine.configure(null, null);%0A    %7D%0A%0A%0A    @Test(expected = IllegalStateException.class)%0A    public void throw_exception_if_not_configured_and_try_to_get_instance() %7B%0A        Engine.getInstance();%0A    %7D%0A%0A    @Test%0A    public void return_instance_if_configured_correctly() %7B%0A%0A        final EventStore eventStore = new EventStore(new MockStorage%3CEventRecord%3E());%0A        final CommandStore commandStore = new CommandStore(new MockStorage%3CCommandRequest%3E());%0A%0A        Engine.configure(commandStore, eventStore);%0A%0A        final Engine engine = Engine.getInstance();%0A%0A        assertNotNull(engine);%0A        assertNotNull(engine.getCommandDispatcher());%0A        assertNotNull(engine.getEventBus());%0A    %7D%0A%0A%0A    public static class MockStorage%3CM extends Message%3E implements StorageWithTimelineAndVersion%3CM%3E %7B%0A        @Override public List%3CM%3E read(Message parentId, int sinceVersion) %7B return null; %7D%0A        @Override public List%3CM%3E read(Timestamp from) %7B return null; %7D%0A        @Override public List%3CM%3E read(Message parentId, Timestamp from) %7B return null; %7D%0A        @Override public List%3CM%3E read(Message parentId) %7B return null; %7D%0A        @Override public List%3CM%3E readAll() %7B return null; %7D%0A        @Override public void store(Message message) %7B%7D%0A    %7D%0A%7D%0A

Add some Engine tests.