IntoImpl extends BaseSqlPart implements Into { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(mTableName); if (mDatabaseName != null) { builder.prepend('.').prepend(mDatabaseName); } builder.prepend("INTO "); } IntoImpl(@Nullable final String databaseName, @NotNull final String tableName, @NotNull final SqlPart previous); @NotNull @Override InsertColumns columns(@NotNull final String... columnNames); @NotNull @Override Values values(@NotNull final Object... expressions); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous();  }
@Test public void prependTo_table_prependsProperSql() { IntoImpl into = new IntoImpl(null, "table", mock(SqlPart.class)); RawSqlBuilder builder = new RawSqlBuilderImpl(); into.prependTo(builder); assertThat(builder.toString(), is("INTO table")); }
@Test public void prependTo_databaseTable_prependsProperSql() { IntoImpl into = new IntoImpl("database", "table", mock(SqlPart.class)); RawSqlBuilder builder = new RawSqlBuilderImpl(); into.prependTo(builder); assertThat(builder.toString(), is("INTO database.table")); }