@@ -0,0 +1,1897 @@
+/*%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.tenant;%0A%0Aimport com.google.protobuf.Timestamp;%0Aimport org.junit.Test;%0Aimport org.spine3.protobuf.Timestamps2;%0A%0Aimport static org.spine3.test.Tests.newTenantUuid;%0A%0A/**%0A * @author Alexander Yevsyukov%0A */%0Apublic class TenantAwareFunction0Should %7B%0A%0A    @Test(expected = IllegalStateException.class)%0A    public void require_current_tenant_set() %7B%0A        final TenantAwareFunction0%3CTimestamp%3E whichTime = new TenantAwareFunction0%3CTimestamp%3E() %7B%0A            @Override%0A            public Timestamp apply() %7B%0A                return Timestamps2.getCurrentTime();%0A            %7D%0A        %7D;%0A%0A        // This should pass.%0A        new TenantAwareOperation(newTenantUuid()) %7B%0A            @Override%0A            public void run() %7B%0A                whichTime.execute();%0A            %7D%0A        %7D.execute();%0A%0A        // This should fail.%0A        whichTime.execute();%0A    %7D%0A%7D%0A

Add test for `TenantAwareFunction0`