@@ -0,0 +1,2639 @@
+/*%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.storage.jdbc.query;%0A%0Aimport io.spine.server.storage.jdbc.ConnectionWrapper;%0Aimport io.spine.server.storage.jdbc.DatabaseException;%0Aimport io.spine.server.storage.jdbc.IdColumn;%0Aimport org.junit.Test;%0A%0Aimport java.sql.PreparedStatement;%0Aimport java.sql.SQLException;%0A%0Aimport static org.mockito.ArgumentMatchers.anyBoolean;%0Aimport static org.mockito.Mockito.doReturn;%0Aimport static org.mockito.Mockito.doThrow;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.spy;%0A%0A/**%0A * @author Dmytro Grankin%0A */%0Apublic class SelectEventRecordsByIdShould %7B%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    @Test(expected = DatabaseException.class)%0A    public void handle_invalid_fetch_size() throws SQLException %7B%0A        final IdColumn idColumn = mock(IdColumn.class);%0A        final SelectEventRecordsById query = spy(SelectEventRecordsById.newBuilder(%22table%22)%0A                                                                       .setIdColumn(idColumn)%0A                                                                       .build());%0A        final ConnectionWrapper connection = mock(ConnectionWrapper.class);%0A        final PreparedStatement statement = mock(PreparedStatement.class);%0A        doReturn(connection).when(query)%0A                            .getConnection(anyBoolean());%0A        doReturn(statement).when(query)%0A                           .prepareStatement(connection);%0A%0A        final int invalidFetchSize = -1;%0A        doThrow(SQLException.class).when(statement)%0A                                   .setFetchSize(invalidFetchSize);%0A        query.execute(invalidFetchSize);%0A    %7D%0A%7D%0A

Add a test for `SelectEventRecordsById`