From e0cdbfa24075cc7e1fc5845d92cca5fa15666cf7 Mon Sep 17 00:00:00 2001 From: nirmalchandra Date: Fri, 29 Sep 2023 14:46:50 +0100 Subject: [PATCH] PR-580 More prettyfied logging for a Scenario - Removed few more WARN to reduce noice --- .../executor/httpapi/HttpApiExecutorImpl.java | 2 +- .../ZeroCodeMultiStepsScenarioRunnerImpl.java | 5 +++- http-testing/src/test/resources/logback.xml | 2 +- kafka-testing/src/test/resources/logback.xml | 23 +++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 kafka-testing/src/test/resources/logback.xml diff --git a/core/src/main/java/org/jsmart/zerocode/core/engine/executor/httpapi/HttpApiExecutorImpl.java b/core/src/main/java/org/jsmart/zerocode/core/engine/executor/httpapi/HttpApiExecutorImpl.java index c3380f0cb..dbd5ea286 100644 --- a/core/src/main/java/org/jsmart/zerocode/core/engine/executor/httpapi/HttpApiExecutorImpl.java +++ b/core/src/main/java/org/jsmart/zerocode/core/engine/executor/httpapi/HttpApiExecutorImpl.java @@ -147,7 +147,7 @@ private Object readJsonPathOrElseNull(String requestJson, String jsonPath) { try { return JsonPath.read(requestJson, jsonPath); } catch (PathNotFoundException pEx) { - LOGGER.warn("No " + jsonPath + " was present in the request. returned null."); + LOGGER.info("No " + jsonPath + " was present in the request. returned null."); return null; } } diff --git a/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeMultiStepsScenarioRunnerImpl.java b/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeMultiStepsScenarioRunnerImpl.java index b718ff4e0..4f7e7d05b 100644 --- a/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeMultiStepsScenarioRunnerImpl.java +++ b/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeMultiStepsScenarioRunnerImpl.java @@ -106,7 +106,10 @@ public class ZeroCodeMultiStepsScenarioRunnerImpl implements ZeroCodeMultiStepsS @Override public synchronized boolean runScenario(ScenarioSpec scenario, RunNotifier notifier, Description description) { - LOGGER.warn("\n-------------------------- BDD: Scenario:{} -------------------------\n", scenario.getScenarioName()); + LOGGER.warn("\n-----------------------------------------------------------------------------------\n" + + "\nScenario:\n+++++++++\n\n{} \n" + + "\n-----------------------------------------------------------------------------------", + scenario.getScenarioName()); ioWriterBuilder = ZeroCodeIoWriteBuilder.newInstance().timeStamp(LocalDateTime.now()); diff --git a/http-testing/src/test/resources/logback.xml b/http-testing/src/test/resources/logback.xml index 65eef84ec..cf1d66aec 100644 --- a/http-testing/src/test/resources/logback.xml +++ b/http-testing/src/test/resources/logback.xml @@ -18,7 +18,7 @@ - + diff --git a/kafka-testing/src/test/resources/logback.xml b/kafka-testing/src/test/resources/logback.xml new file mode 100644 index 000000000..96ed0d996 --- /dev/null +++ b/kafka-testing/src/test/resources/logback.xml @@ -0,0 +1,23 @@ + + + + target/logs/sponsorship_ingestion.log + true + + + %d [%thread] %-5level %logger{30} - %msg%n + + + + + + %d [%thread] %-5level %logger{30} - %msg%n + + + + + + + + + \ No newline at end of file