@@ -0,0 +1,2359 @@
+/*%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 */%0Apackage org.spine3.server.failure;%0A%0Aimport org.junit.Test;%0Aimport org.spine3.test.Tests;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0A/**%0A * @author Alex Tymchenko%0A */%0Apublic class FailureBusBuilderShould %7B%0A%0A    @Test(expected = NullPointerException.class)%0A    public void do_not_accept_null_DispatcherDelivery() %7B%0A        FailureBus.newBuilder()%0A                  .setDispatcherFailureDelivery(Tests.%3CDispatcherFailureDelivery%3EnullRef());%0A    %7D%0A%0A    @SuppressWarnings(%22OptionalGetWithoutIsPresent%22)    //It's fine as for the Builder tests%0A    @Test%0A    public void return_set_DispatcherDelivery() %7B%0A        final DispatcherFailureDelivery delivery = deliveryForTests();%0A        assertEquals(delivery, FailureBus.newBuilder()%0A                                         .setDispatcherFailureDelivery(delivery)%0A                                         .getDispatcherFailureDelivery()%0A                                         .get());%0A    %7D%0A%0A    private static DispatcherFailureDelivery deliveryForTests() %7B%0A        return new DispatcherFailureDelivery() %7B%0A            @Override%0A            protected boolean shouldPostponeDelivery(FailureEnvelope deliverable,%0A                                                     FailureDispatcher consumer) %7B%0A                return false;   // does not really matter for tests.%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Create some tests for the `FailureBus.Builder`.