@@ -0,0 +1,1984 @@
+package de.henninglanghorst.functional.sql;%0A%0Aimport de.henninglanghorst.functional.sql.function.Function;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnit;%0Aimport org.mockito.junit.MockitoRule;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0A%0Aimport static de.henninglanghorst.functional.sql.DatabaseStatementFunctions.statement;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport static org.mockito.BDDMockito.given;%0Aimport static org.mockito.Mockito.verify;%0A%0A/**%0A * Tests for functions in %7B@link DatabaseStatementFunctions%7D.%0A *%0A * @author Henning Langhorst%0A */%0Apublic class DatabaseStatementFunctionsTest %7B%0A%0A    @Rule%0A    public MockitoRule mockitoRule = MockitoJUnit.rule();%0A%0A    @Mock%0A    private Connection connection;%0A%0A    @Mock%0A    private PreparedStatement preparedStatement;%0A%0A    @Test%0A    public void statementShouldReturnFunctionCreatingStatementFromConnection() throws Exception %7B%0A        // given%0A        final String sql = %22select 1 from dual%22;%0A        given(connection.prepareStatement(sql)).willReturn(preparedStatement);%0A        // when%0A        final Function%3CConnection, PreparedStatement%3E statementFunction = statement(sql);%0A        // then%0A        assertThat(statementFunction.apply(connection)).isSameAs(preparedStatement);%0A    %7D%0A%0A    @Test%0A    public void statementShouldReturnFunctionCreatingStatementFromConnectionAndParameters() throws Exception %7B%0A        // given%0A        final String sql = %22select 1 from dual where name = ?%22;%0A        String stringParam = %22SomeName%22;%0A        given(connection.prepareStatement(sql)).willReturn(preparedStatement);%0A        // when%0A        final Function%3CConnection, PreparedStatement%3E statementFunction = statement(sql, stringParam);%0A        // then%0A        final PreparedStatement stmt = statementFunction.apply(connection);%0A        assertThat(stmt).isSameAs(preparedStatement);%0A        verify(stmt).setObject(1, stringParam);%0A    %7D%0A%7D

Create tests