@@ -0,0 +1,2088 @@
+/*%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 io.spine.server.entity.idfunc;%0A%0Aimport com.google.protobuf.Message;%0Aimport io.spine.test.Tests;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNotNull;%0A%0A/**%0A * @author Alexander Yevsyukov%0A */%0Apublic class ProducersShould %7B%0A%0A    @Test%0A    public void have_utility_ctor() %7B%0A        Tests.assertHasPrivateParameterlessCtor(Producers.class);%0A    %7D%0A%0A    @Test%0A    public void create_function_for_taking_id_fromContext() %7B%0A        final EventTargetsFunction%3CObject, Message%3E fn = Producers.fromContext();%0A        assertFunction(fn);%0A    %7D%0A%0A    @Test%0A    public void create_function_for_getting_id_fromFirstMessageField() %7B%0A        final EventTargetsFunction%3CObject, Message%3E fn = Producers.fromFirstMessageField();%0A        assertFunction(fn);%0A    %7D%0A%0A    private static void assertFunction(EventTargetsFunction%3CObject, Message%3E fn) %7B%0A        assertNotNull(fn);%0A%0A        // Check that custom toString() is provided.%0A        assertFalse(fn.toString().contains(EventTargetsFunction.class.getSimpleName()));%0A    %7D%0A%7D%0A

Test `Producers` utility class