@NotNull public static Analyze analyze() { return new AnalyzeImpl(); }
@Test public void appendAnalyzeDatabaseAndTableOrIndex_appendsProperSql() { /* Given */ AnalyzeImpl analyze = new AnalyzeImpl().databaseAndTableOrIndex("database", "table"); RawSqlBuilder builder = new RawSqlBuilderImpl(); /* When */ analyze.prependTo(builder); /* Then */ assertThat(builder.toString(), is("ANALYZE database.table")); }
@Test public void appendAnalyzeDatabase_appendsProperSql() { /* Given */ AnalyzeImpl analyze = new AnalyzeImpl().database("database"); RawSqlBuilder builder = new RawSqlBuilderImpl(); /* When */ analyze.prependTo(builder); /* Then */ assertThat(builder.toString(), is("ANALYZE database")); }
@Test public void appendAnalyzeTableOrIndex_appendsProperSql() { /* Given */ AnalyzeImpl analyze = new AnalyzeImpl().tableOrIndex("table"); RawSqlBuilder builder = new RawSqlBuilderImpl(); /* When */ analyze.prependTo(builder); /* Then */ assertThat(builder.toString(), is("ANALYZE table")); }
@Test public void previous_returnsNull() { /* Given */ AnalyzeImpl analyze = new AnalyzeImpl(); /* When */ SqlPart previous = analyze.previous(); /* Then */ assertThat(previous, is(nullValue())); } }
@Test public void appendEmptyAnalyze_appendsProperSql() { /* Given */ AnalyzeImpl analyze = new AnalyzeImpl(); RawSqlBuilder builder = new RawSqlBuilderImpl(); /* When */ analyze.prependTo(builder); /* Then */ assertThat(builder.toString(), is("ANALYZE")); }