From 9c414d7dbbe337c365b52f708ccd1c4ccf36021c Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Thu, 18 Jun 2020 15:23:12 -0400 Subject: Decouple TXT Report file writing and formatting logic (2/6) This commit aims to move the reportStartValidatorRun function's logic from ReportManager (deprecated) to ReportFile. Signed-off-by: Francis Toth Change-Id: I93c2e8f98cdef598094647d734d0deec0f1941db Issue-ID: SDC-2499 --- .../asdctool/impl/validator/utils/ReportManagerTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'asdctool/src/test') diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java index 53e56687a8..479421e118 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java @@ -176,15 +176,16 @@ public class ReportManagerTest { @Test public void testReportStartValidatorRun() { // when - ReportManager.reportStartValidatorRun(VALIDATOR_NAME, COMPONENT_SUM, txtReportFilePath); - - List reportOutputFile = ReportManagerHelper.getReportOutputFileAsList(txtReportFilePath); + List reportTxtFile = ReportFileNioHelper.withTxtFile(txtReportFilePath, file -> { + file.reportStartValidatorRun(VALIDATOR_NAME, COMPONENT_SUM); + return ReportFileNioHelper.readFileAsList(txtReportFilePath); + }); // then - assertNotNull(reportOutputFile); - assertEquals(EXPECTED_OUTPUT_FILE_HEADER, reportOutputFile.get(0)); + assertNotNull(reportTxtFile); + assertEquals(EXPECTED_OUTPUT_FILE_HEADER, reportTxtFile.get(0)); assertEquals("------ValidatorExecuter " + VALIDATOR_NAME + " Validation Started, on " - + COMPONENT_SUM + " components---------", reportOutputFile.get(2)); + + COMPONENT_SUM + " components---------", reportTxtFile.get(2)); } @Test -- cgit 1.2.3-korg