From b29518ad6136fe628d7aff79d5fc607c5e890729 Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Thu, 18 Jun 2020 15:35:05 -0400 Subject: Decouple TXT Report file writing and formatting logic (4/6) This commit aims to move the reportValidatorTypeSummary function from ReportManager (deprecated) to ReportFile. Signed-off-by: Francis Toth Change-Id: I30898d69bbcdb129a2dac917c4dee3c276556e91 Issue-ID: SDC-2499 --- .../impl/validator/utils/ReportManagerTest.java | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 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 9a237af812..e78ab31763 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 @@ -156,21 +156,18 @@ public class ReportManagerTest { @Test public void testReportValidatorTypeSummary() { // when - ReportManager - .reportValidatorTypeSummary(VALIDATOR_NAME, failedTasksNames, successTasksNames, txtReportFilePath); - - List reportOutputFile = ReportManagerHelper.getReportOutputFileAsList(txtReportFilePath); + List reportTxtFile = ReportFileNioHelper.withTxtFile(txtReportFilePath, file -> { + file.reportValidatorTypeSummary(VALIDATOR_NAME, failedTasksNames, successTasksNames); + 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 Summary-----------------------", reportOutputFile.get(2)); - assertEquals("Failed tasks: [" + TASK_1_FAILED_NAME + ", " + TASK_2_FAILED_NAME + "]", - reportOutputFile.get(3)); - assertEquals("Success tasks: [" + TASK_1_NAME + ", " + TASK_2_NAME + "]", - reportOutputFile.get(4)); + + " Validation Summary-----------------------", reportTxtFile.get(2)); + assertEquals("Failed tasks: [" + TASK_1_FAILED_NAME + ", " + TASK_2_FAILED_NAME + "]", reportTxtFile.get(3)); + assertEquals("Success tasks: [" + TASK_1_NAME + ", " + TASK_2_NAME + "]", reportTxtFile.get(4)); } @Test -- cgit 1.2.3-korg