TableInfo { public String getFileName(String entityName, String value, Supplier<String> defaultValue) { return StringUtils.isNotBlank(value) ? String.format(value, entityName) : defaultValue.get(); }  @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 getFileNameTest() { TableInfo tableInfo = new TableInfo(); Assertions.assertEquals("UserEntity", tableInfo.getFileName("User", "", () -> "UserEntity")); Assertions.assertEquals("UserEntity", tableInfo.getFileName("User", null, () -> "UserEntity")); Assertions.assertEquals("UserTable", tableInfo.getFileName("User", "%sTable", () -> "UserEntity")); Assertions.assertEquals("UserTable", tableInfo.getFileName("User", "UserTable", () -> "UserEntity")); }