TableInfo { public String getFieldNames() { if (StringUtils.isBlank(fieldNames)) { this.fieldNames = this.fields.stream().map(TableField::getColumnName).collect(Collectors.joining(", ")); } return this.fieldNames; }  @Deprecated TableInfo setConvert(boolean convert); String getEntityPath(); @Deprecated TableInfo setEntityName(String entityName); TableInfo setEntityName(StrategyConfig strategyConfig, String entityName); @Deprecated TableInfo setFields(List<TableField> fields); TableInfo addFields(List<TableField> fields); TableInfo addFields(TableField... fields); @Deprecated TableInfo setImportPackages(String pkg); TableInfo addImportPackages(String... pkgs); boolean isLogicDelete(String logicDeletePropertyName); @Deprecated TableInfo setFieldNames(String fieldNames); String getFieldNames(); @Deprecated TableInfo setCommonFields(List<TableField> commonFields); TableInfo addCommonFields(TableField... commonFields); TableInfo addCommonFields(List<TableField> commonFields); void importPackage(StrategyConfig strategyConfig, GlobalConfig globalConfig); void processTable(StrategyConfig strategyConfig, GlobalConfig globalConfig); String getFileName(String entityName, String value, Supplier<String> defaultValue);  }
@Test void getFieldNamesTest() { TableInfo tableInfo; tableInfo = new TableInfo(); tableInfo.addFields(new TableField().setColumnName("name")); Assertions.assertEquals(tableInfo.getFieldNames(), "name"); tableInfo = new TableInfo(); tableInfo.addFields(new TableField().setColumnName("name"), new TableField().setColumnName("age")); Assertions.assertEquals(tableInfo.getFieldNames(), "name, age"); tableInfo = new TableInfo(); tableInfo.addFields(new TableField().setColumnName("name"), new TableField().setColumnName("age"), new TableField().setColumnName("phone")); Assertions.assertEquals(tableInfo.getFieldNames(), "name, age, phone"); }