Validator { static String sanitizeTable(String name, QueryBuilderOptions options) { return (options.autoQuoteTableNames ? options.nameQuoteCharacter + name + options.nameQuoteCharacter : name); } private  Validator();   }
@Test public void sanitizeTableAutoQuoteTableNames() { QueryBuilderOptions options = new QueryBuilderOptions(); options.autoQuoteTableNames = true; String fieldName = "NAME"; String actual = Validator.sanitizeTable(fieldName, options); String expected = "`NAME`"; assertEquals(expected, actual); }
@Test public void sanitizeTableNoAutoQuoteTableNames() { QueryBuilderOptions options = new QueryBuilderOptions(); options.autoQuoteTableNames = false; String fieldName = "NAME"; String actual = Validator.sanitizeTable(fieldName, options); String expected = "NAME"; assertEquals(expected, actual); }