From ebdd74e8fbea505605afae3ef7b11ba82f8b048a Mon Sep 17 00:00:00 2001 From: Viktor Sidochenko Date: Sun, 7 Apr 2019 13:33:47 +0700 Subject: [PATCH] change kinks api to conform common style --- .gitignore | 4 +++- .../tag/datajack/providers/excel/ExcelDataProvider.java | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 66baa9d..aba9b2a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ *.iml .classpath .vscode/ -.settings/ \ No newline at end of file +.settings/ +.DS_Store +**/.factorypath diff --git a/providers/excel-provider/src/main/java/ru/sbtqa/tag/datajack/providers/excel/ExcelDataProvider.java b/providers/excel-provider/src/main/java/ru/sbtqa/tag/datajack/providers/excel/ExcelDataProvider.java index 69f3dc1..31d2b91 100644 --- a/providers/excel-provider/src/main/java/ru/sbtqa/tag/datajack/providers/excel/ExcelDataProvider.java +++ b/providers/excel-provider/src/main/java/ru/sbtqa/tag/datajack/providers/excel/ExcelDataProvider.java @@ -26,11 +26,11 @@ import static java.lang.String.format; -@SuppressWarnings("deprecation") public class ExcelDataProvider extends AbstractDataProvider { private static final Logger LOG = LoggerFactory.getLogger(ExcelDataProvider.class); private static final String DEFAULT_EXTENSION = "xlsx"; + private static final String REF_TPL = "$ref:"; private final XSSFWorkbook workBook; private final String dataFileName; private XSSFFormulaEvaluator evaluator; @@ -212,13 +212,13 @@ private String getName(XSSFRow row) { } private boolean isLink(XSSFRow row) { - return getCellValue(row.getCell(2)).contains("link:"); + return getCellValue(row.getCell(2)).startsWith(REF_TPL); } private BasicDBObject getLink(XSSFRow row) { - String linkPath = getCellValue(row.getCell(2)).replace("link:", ""); + String linkPath = getCellValue(row.getCell(2)).replace(REF_TPL, ""); BasicDBObject link = new BasicDBObject(); - String[] fullPathDelimited = linkPath.split("[.]", 2); + String[] fullPathDelimited = linkPath.split("[:]", 2); // Link to another sheetName (sheet) link.append(COLLECTION_TPL, fullPathDelimited[0]); link.append("path", fullPathDelimited[1]);