/*
 *
 * Copyright 2016, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
package org.spine3.server.stand;

/**
 * @author Alex Tymchenko
 */
public class StandFunnelShould {

    // **** Positive scenarios (unit) ****

    /**
     * - Initialize properly with various Builder options;
     * - deliver mock updates to the stand (invoke proper methods with particular arguments) - test the delivery only.
     */


    // **** Negative scenarios (unit) ****

    /**
     * - Fail to initialise with improper stand.
     */

    // **** Integration scenarios (<source> -> StandFunnel -> Mock Stand) ****

    /**
     * - Deliver updates from projection repo on update;
     * - deliver updates from aggregate repo on update;
     * - deliver the updates from several projection and aggregate repositories.
     */
}

@@ -1049,16 +1049,311 @@
 stand;%0A%0A
+import com.google.protobuf.Any;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.spine3.testdata.TestStandFactory;%0A%0Aimport java.util.concurrent.Executor;%0A%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.Mockito.spy;%0Aimport static org.mockito.Mockito.verify;%0A%0A
 /**%0A * @
@@ -1655,117 +1655,1551 @@
 */%0A%0A
-%0A    // **** Negative scenarios (unit) ****%0A%0A    /**%0A     * - Fail to initialise with improper stand.%0A     */
+    @Test%0A    public void initialize_properly_with_stand_only() %7B%0A        final Stand stand = TestStandFactory.create();%0A        final StandFunnel.Builder builder = StandFunnel.newBuilder()%0A                                                       .setStand(stand);%0A        final StandFunnel standFunnel = builder.build();%0A        Assert.assertNotNull(standFunnel);%0A    %7D%0A%0A%0A    @Test%0A    public void use_executor_from_builder() %7B%0A        final Stand stand = spy(TestStandFactory.create());%0A        final Executor executor = spy(new Executor() %7B%0A            @Override%0A            public void execute(Runnable command) %7B%0A%0A            %7D%0A        %7D);%0A        final StandFunnel.Builder builder = StandFunnel.newBuilder()%0A                                                       .setStand(stand)%0A                                                       .setExecutor(executor);%0A%0A        final StandFunnel standFunnel = builder.build();%0A        Assert.assertNotNull(standFunnel);%0A%0A        final Any someState = Any.getDefaultInstance();%0A        final Object someId = new Object();%0A        standFunnel.post(someId, someState);%0A%0A        verify(executor).execute(any(Runnable.class));%0A    %7D%0A%0A%0A    // **** Negative scenarios (unit) ****%0A%0A    /**%0A     * - Fail to initialise with improper stand.%0A     */%0A%0A    @SuppressWarnings(%22ResultOfMethodCallIgnored%22)%0A    @Test(expected = IllegalStateException.class)%0A    public void fail_to_initialize_from_empty_builder() %7B%0A        final StandFunnel.Builder builder = StandFunnel.newBuilder();%0A        builder.build();%0A    %7D
 %0A%0A  
@@ -3486,10 +3486,12 @@
      */%0A
+%0A%0A
 %7D%0A

Add some StandFunnel tests as a start.