/*
 * 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;

/**
 * @author Dmytro Dashenkov
 */
public class SubscriptionServiceShould {


}

@@ -1042,85 +1042,3524 @@
 r;%0A%0A
-/**%0A * @author Dmytro Dashenkov%0A */%0Apublic class SubscriptionServiceShould %7B%0A%0A
+import org.junit.Test;%0Aimport org.spine3.server.stand.Stand;%0Aimport org.spine3.server.storage.memory.InMemoryStandStorage;%0Aimport org.spine3.server.storage.memory.InMemoryStorageFactory;%0A%0Aimport static org.junit.Assert.assertNotNull;%0A%0A/**%0A * @author Dmytro Dashenkov%0A */%0Apublic class SubscriptionServiceShould %7B%0A%0A    /*%0A     * Creation tests%0A     * --------------%0A     */%0A%0A    @Test%0A    public void initialize_properly_with_one_bounded_context() %7B%0A        final BoundedContext singleBoundedContext = newBoundedContext(%22Single%22);%0A%0A        final SubscriptionService subscriptionService = SubscriptionService.newBuilder()%0A                                                                           .addBoundedContext(singleBoundedContext)%0A                                                                           .build();%0A%0A        assertNotNull(subscriptionService);%0A    %7D%0A%0A    @Test%0A    public void initialize_properly_with_several_bounded_contexts() %7B%0A        final BoundedContext firstBoundedContext = newBoundedContext(%22First%22);%0A        final BoundedContext secondBoundedContext = newBoundedContext(%22Second%22);%0A        final BoundedContext thirdBoundedContext = newBoundedContext(%22Third%22);%0A%0A%0A        final SubscriptionService subscriptionService = SubscriptionService.newBuilder()%0A                                                                           .addBoundedContext(firstBoundedContext)%0A                                                                           .addBoundedContext(secondBoundedContext)%0A                                                                           .addBoundedContext(thirdBoundedContext)%0A                                                                           .build();%0A%0A        assertNotNull(subscriptionService);%0A    %7D%0A%0A    @Test%0A    public void be_able_to_remove_bounded_context_from_builder() %7B%0A        final BoundedContext firstBoundedContext = newBoundedContext(%22Removed%22);%0A        final BoundedContext secondBoundedContext = newBoundedContext(%22Also removed%22);%0A        final BoundedContext thirdBoundedContext = newBoundedContext(%22The one to stay%22);%0A%0A%0A        final SubscriptionService subscriptionService = SubscriptionService.newBuilder()%0A                                                                           .addBoundedContext(firstBoundedContext)%0A                                                                           .addBoundedContext(secondBoundedContext)%0A                                                                           .addBoundedContext(thirdBoundedContext)%0A                                                                           .removeBoundedContext(secondBoundedContext)%0A                                                                           .removeBoundedContext(firstBoundedContext)%0A                                                                           .build();%0A%0A        assertNotNull(subscriptionService);%0A    %7D%0A%0A    @Test(expected = IllegalStateException.class)%0A    public void fail_to_initialize_from_empty_builder() %7B%0A        SubscriptionService.newBuilder().build();%0A    %7D%0A%0A    private static BoundedContext newBoundedContext(String name) %7B%0A        final Stand stand = Stand.newBuilder().setStorage(InMemoryStandStorage.newBuilder().build()).build();%0A%0A        return BoundedContext.newBuilder()%0A                             .setStand(stand)%0A                             .setName(name)%0A                             .setStorageFactory(InMemoryStorageFactory.getInstance())%0A                             .build();%0A%0A    %7D
 %0A%7D%0A

Add creation tests for subscription service.