### Question:
DefaultDialect implements Dialect { @Override public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset) { LOGGER.error("ERROR!!!! Limit and Offset are not supported by DefaultDialect"); StringBuilder queryBuilder = new StringBuilder(); appendSelect(queryBuilder, tableName, columns, null, subQuery, orderBys); return queryBuilder.toString(); }  @Override String selectStar(String table); @Override String selectStar(String table, String where); @Override String selectStarParametrized(String table, String ... parameters); @Override String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset); @Override Object overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value); @Override String selectCount(String from); @Override String selectCount(String table, String where); @Override String selectExists(MetaModel metaModel); @Override String selectManyToManyAssociation(Many2ManyAssociation association, String sourceFkColumnName, int questionsCount); @Override String insertManyToManyAssociation(Many2ManyAssociation association); @Override String insertParametrized(MetaModel metaModel, List<String> columns, boolean containsId); @Override String deleteManyToManyAssociation(Many2ManyAssociation association); @Override String insert(MetaModel metaModel, Map<String, Object> attributes, String ... replacements); @Override String update(MetaModel metaModel, Map<String, Object> attributes, String ... replacements);  }### Answer:
@Test public void testFormSelectWithoutTableName() { final String fullQuery = "SELECT name FROM people"; a(dialect.formSelect( null, new String[]{"name"}, fullQuery, new ArrayList(), 1, 1)) .shouldBeEqual(fullQuery); }
@Test public void testFormSelectWithTableName() { a(dialect.formSelect("people", null, null, new ArrayList<String>(), 1, 1)) .shouldBeEqual("SELECT * FROM people"); a(dialect.formSelect("people", null, "name = ?", new ArrayList<String>(), 1, 1)) .shouldBeEqual("SELECT * FROM people WHERE name = ?"); a(dialect.formSelect("people", null, "name = ?", Arrays.asList("name"), 1, 1)) .shouldBeEqual("SELECT * FROM people WHERE name = ? ORDER BY name"); a(dialect.formSelect("people", null, null, Arrays.asList("last_name", "name"), 1, 1)) .shouldBeEqual("SELECT * FROM people ORDER BY last_name, name"); }
@Test public void testFormSelectWithOrderBy() { a(dialect.formSelect( "people", null, " ORDER by last_name", new ArrayList<String>(), 1, 1)) .shouldBeEqual("SELECT * FROM people ORDER by last_name"); }