Repository: authorjapps/zerocode
Pull request #62 (2018-04-13 22:18:48)

ISS-51 single CSV report


Patch:
diff --git a/src/main/java/org/jsmart/zerocode/core/domain/reports/ZeroCodeReportProperties.java b/src/main/java/org/jsmart/zerocode/core/domain/reports/ZeroCodeReportProperties.java
index 878c2bd0..9c0b9cd2 100644
--- a/src/main/java/org/jsmart/zerocode/core/domain/reports/ZeroCodeReportProperties.java
+++ b/src/main/java/org/jsmart/zerocode/core/domain/reports/ZeroCodeReportProperties.java
@@ -1,13 +1,13 @@
 package org.jsmart.zerocode.core.domain.reports;
 
 public interface ZeroCodeReportProperties {
-    String TEST_STEP_CORRELATION_ID = "TEST-STEP-CORRELATION-ID:";
-    String TARGET_FILE_NAME = "target/zerocode-interactive.html";
-    String TARGET_REPORT_DIR = "target/zerocode-test-reports/";
-    String TARGET_FULL_REPORT_DIR = "target/";
-    String TARGET_FULL_REPORT_CSV_FILE_NAME = "zerocode_full_report";
     String RESULT_PASS = "PASSED";
     String RESULT_FAIL = "FAILED";
+    String TEST_STEP_CORRELATION_ID = "TEST-STEP-CORRELATION-ID:";
+    String TARGET_FULL_REPORT_DIR = "target/";
+    String TARGET_REPORT_DIR = "target/zerocode-test-reports/";
+    String TARGET_FULL_REPORT_CSV_FILE_NAME = "zerocode-junit-granular-report.csv";
+    String TARGET_FILE_NAME = "target/zerocode-junit-interactive-fuzzy-search.html";
     String HIGH_CHART_HTML_FILE_NAME = "zerocode_results_chart";
     String AUTHOR_MARKER = "@@";
     String ANONYMOUS_AUTHOR = "Anonymous";
diff --git a/src/main/java/org/jsmart/zerocode/core/engine/executor/JsonServiceExecutorImpl.java b/src/main/java/org/jsmart/zerocode/core/engine/executor/JsonServiceExecutorImpl.java
index 2b168d98..78aae415 100644
--- a/src/main/java/org/jsmart/zerocode/core/engine/executor/JsonServiceExecutorImpl.java
+++ b/src/main/java/org/jsmart/zerocode/core/engine/executor/JsonServiceExecutorImpl.java
@@ -7,7 +7,6 @@ import com.google.inject.Inject;
 import com.google.inject.name.Named;
 import com.jayway.jsonpath.JsonPath;
 import com.jayway.jsonpath.PathNotFoundException;
-
 import org.jsmart.zerocode.core.domain.MockSteps;
 import org.jsmart.zerocode.core.domain.Response;
 import org.jsmart.zerocode.core.httpclient.BasicHttpClient;
@@ -16,7 +15,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.core.MultivaluedMap;
-
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
@@ -84,11 +82,15 @@ public class JsonServiceExecutorImpl implements JsonServiceExecutor {
 
             return responseJson;
 
-        } catch (Exception exc) {
+        } catch (Throwable severError) {
 
-            exc.printStackTrace();
+            LOGGER.error("Ooooooooooops! There something unexpected happen at port: {}, " +
+                    "\n1) Check if any other service is running at this port." +
+                    "\n2) Stop the other service at this port. -or- " +
+                    "\n3) Configure WireMock to another port which might fix this problem.\n" +
+                    "See complete error below-", mockPort, severError);
 
-            throw new RuntimeException(exc);
+            throw new RuntimeException(severError);
 
         }
     }
diff --git a/src/main/java/org/jsmart/zerocode/core/httpclient/soap/SoapCorporateProxySslHttpClient.java b/src/main/java/org/jsmart/zerocode/core/httpclient/soap/SoapCorporateProxySslHttpClient.java
index 77e6dba4..9c34dc90 100644
--- a/src/main/java/org/jsmart/zerocode/core/httpclient/soap/SoapCorporateProxySslHttpClient.java
+++ b/src/main/java/org/jsmart/zerocode/core/httpclient/soap/SoapCorporateProxySslHttpClient.java
@@ -96,6 +96,7 @@ public class SoapCorporateProxySslHttpClient implements BasicHttpClient {
         if (headers != null) {
             Map headersMap = headers;
             for (Object key : headersMap.keySet()) {
+                removeDuplicateHeaders(requestBuilder, (String) key);
                 requestBuilder.addHeader((String) key, (String) headersMap.get(key));
             }
         }
@@ -193,5 +194,10 @@ public class SoapCorporateProxySslHttpClient implements BasicHttpClient {
         return qualifiedQueryParam;
     }
 
+    private void removeDuplicateHeaders(RequestBuilder requestBuilder, String key) {
+        if(requestBuilder.getFirstHeader(key) != null) {
+            requestBuilder.removeHeaders(key);
+        }
+    }
 }
 
diff --git a/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/CorporateProxyNoSslContextHttpClient.java b/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/CorporateProxyNoSslContextHttpClient.java
new file mode 100644
index 00000000..c2accb3b
--- /dev/null
+++ b/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/CorporateProxyNoSslContextHttpClient.java
@@ -0,0 +1,203 @@
+package org.jsmart.zerocode.core.httpclient.ssl;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.Header;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CookieStore;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.entity.EntityBuilder;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.RequestBuilder;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.jsmart.zerocode.core.httpclient.BasicHttpClient;
+import org.jsmart.zerocode.core.utils.HelperJsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.core.Response;
+import java.security.KeyManagementException;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import static java.lang.String.format;
+import static org.apache.http.entity.ContentType.APPLICATION_JSON;
+import static org.jsmart.zerocode.core.utils.HelperJsonUtils.getContentAsItIsJson;
+
+public class CorporateProxyNoSslContextHttpClient implements BasicHttpClient {
+    private static final Logger LOGGER = LoggerFactory.getLogger(CorporateProxyNoSslContextHttpClient.class);
+
+    @Inject
+    @Named("corporate.proxy.host")
+    private String proxyHost;
+
+    @Inject
+    @Named("corporate.proxy.port")
+    private int proxyPort;
+
+    @Inject
+    @Named("corporate.proxy.username")
+    private String proxyUserName;
+
+    @Inject
+    @Named("corporate.proxy.password")
+    private String proxyPassword;
+
+    private Object COOKIE_JSESSIONID_VALUE;
+
+    @Override
+    public Response execute(String httpUrl, String methodName, Map<String, Object> headers, Map<String, Object> queryParams, Object body) throws Exception {
+
+        LOGGER.info("###SOAP Http Client with Corporate Proxy enabled via SSL");
+
+        /** ---------------------------
+         * Get the request body content
+         * ----------------------------
+         */
+        String reqBodyAsString = getContentAsItIsJson(body);
+
+        CloseableHttpClient httpclient = createSslHttpClient();
+
+        /** -----------------------
+         * set the query parameters
+         * ------------------------
+         */
+        if (queryParams != null) {
+            httpUrl = setQueryParams(httpUrl, queryParams);
+        }
+
+        RequestBuilder requestBuilder = RequestBuilder
+                .create(methodName)
+                .setUri(httpUrl);
+
+        if (reqBodyAsString != null) {
+            HttpEntity httpEntity = EntityBuilder.create()
+                    .setContentType(APPLICATION_JSON)
+                    .setText(reqBodyAsString)
+                    .build();
+            requestBuilder.setEntity(httpEntity);
+        }
+
+        /** --------------
+         * set the headers
+         * ---------------
+         */
+        if (headers != null) {
+            Map headersMap = headers;
+            for (Object key : headersMap.keySet()) {
+                removeDuplicateHeaders(requestBuilder, (String) key);
+                requestBuilder.addHeader((String) key, (String) headersMap.get(key));
+            }
+        }
+
+        /** -----------------------------------------------------------------------------------
+         * Setting cookies:
+         *
+         * Highly discouraged to use sessions, but in case of any server dependent upon session,
+         * then it's taken care here.
+         * ------------------------------------------------------------------------------------
+         */
+        if (COOKIE_JSESSIONID_VALUE != null) {
+            requestBuilder.addHeader("Cookie", (String) COOKIE_JSESSIONID_VALUE);
+        }
+
+        /** ----------------------
+         * now execute the request
+         * -----------------------
+         */
+        CloseableHttpResponse httpResponse = httpclient.execute(requestBuilder.build());
+
+        Response serverResponse = Response
+                .status(httpResponse.getStatusLine().getStatusCode())
+                .entity(IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"))
+                .build();
+
+
+        Header[] allHeaders = httpResponse.getAllHeaders();
+        Response.ResponseBuilder responseBuilder = Response.fromResponse(serverResponse);
+        for (Header thisHeader : allHeaders) {
+            String headerKey = thisHeader.getName();
+            responseBuilder = responseBuilder.header(headerKey, thisHeader.getValue());
+
+            /** ---------------
+             * Session handled
+             * ----------------
+             */
+            if ("Set-Cookie".equals(headerKey)) {
+                COOKIE_JSESSIONID_VALUE = serverResponse.getMetadata().get(headerKey);
+            }
+        }
+        serverResponse = responseBuilder.build();
+
+        return serverResponse;
+    }
+
+    private CloseableHttpClient createSslHttpClient() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException {
+        SSLContext sslContext = new SSLContextBuilder()
+                .loadTrustMaterial(null, (certificate, authType) -> true).build();
+
+        CookieStore cookieStore = new BasicCookieStore();
+
+        CredentialsProvider credsProvider = createProxyCredentialsProvider(proxyHost, proxyPort, proxyUserName, proxyPassword);
+
+        HttpHost proxy = new HttpHost(proxyHost, proxyPort);
+
+        return HttpClients.custom()
+                //.setSSLContext(sslContext)
+                .setSSLHostnameVerifier(new NoopHostnameVerifier())
+                .setDefaultCookieStore(cookieStore)
+                .setDefaultCredentialsProvider(credsProvider)
+                .setProxy(proxy)
+                .build();
+    }
+
+    private CredentialsProvider createProxyCredentialsProvider(String proxyHost, int proxyPort, String proxyUserName, String proxyPassword) {
+
+        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+
+        credsProvider.setCredentials(
+                new AuthScope(proxyHost, proxyPort),
+                new UsernamePasswordCredentials(proxyUserName, proxyPassword));
+
+        return credsProvider;
+
+    }
+
+
+    private String setQueryParams(String httpUrl, Map<String, Object> queryParams) {
+        String qualifiedQueryParams = createQualifiedQueryParams(queryParams);
+        httpUrl = httpUrl + qualifiedQueryParams;
+        return httpUrl;
+    }
+
+    private String createQualifiedQueryParams(Object queryParams) {
+        String qualifiedQueryParam = "?";
+        Map queryParamsMap = HelperJsonUtils.readHeadersAsMap(queryParams);
+        for (Object key : queryParamsMap.keySet()) {
+            if ("?".equals(qualifiedQueryParam)) {
+                qualifiedQueryParam = qualifiedQueryParam + format("%s=%s", key, queryParamsMap.get(key));
+            } else {
+                qualifiedQueryParam = qualifiedQueryParam + format("&%s=%s", key, queryParamsMap.get(key));
+            }
+        }
+        return qualifiedQueryParam;
+    }
+
+    private void removeDuplicateHeaders(RequestBuilder requestBuilder, String key) {
+        if(requestBuilder.getFirstHeader(key) != null) {
+            requestBuilder.removeHeaders(key);
+        }
+    }
+}
+
diff --git a/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustCorporateProxyHttpClient.java b/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustCorporateProxyHttpClient.java
new file mode 100644
index 00000000..278afe5c
--- /dev/null
+++ b/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustCorporateProxyHttpClient.java
@@ -0,0 +1,203 @@
+package org.jsmart.zerocode.core.httpclient.ssl;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import org.apache.commons.io.IOUtils;
+import org.apache.http.Header;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CookieStore;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.entity.EntityBuilder;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.RequestBuilder;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.jsmart.zerocode.core.httpclient.BasicHttpClient;
+import org.jsmart.zerocode.core.utils.HelperJsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.core.Response;
+import java.security.KeyManagementException;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.util.Map;
+
+import static java.lang.String.format;
+import static org.apache.http.entity.ContentType.APPLICATION_JSON;
+import static org.jsmart.zerocode.core.utils.HelperJsonUtils.getContentAsItIsJson;
+
+public class SslTrustCorporateProxyHttpClient implements BasicHttpClient {
+    private static final Logger LOGGER = LoggerFactory.getLogger(SslTrustCorporateProxyHttpClient.class);
+
+    @Inject
+    @Named("corporate.proxy.host")
+    private String proxyHost;
+
+    @Inject
+    @Named("corporate.proxy.port")
+    private int proxyPort;
+
+    @Inject
+    @Named("corporate.proxy.username")
+    private String proxyUserName;
+
+    @Inject
+    @Named("corporate.proxy.password")
+    private String proxyPassword;
+
+    private Object COOKIE_JSESSIONID_VALUE;
+
+    @Override
+    public Response execute(String httpUrl, String methodName, Map<String, Object> headers, Map<String, Object> queryParams, Object body) throws Exception {
+
+        LOGGER.info("###SOAP Http Client with Corporate Proxy enabled via SSL");
+
+        /** ---------------------------
+         * Get the request body content
+         * ----------------------------
+         */
+        String reqBodyAsString = getContentAsItIsJson(body);
+
+        CloseableHttpClient httpclient = createSslHttpClient();
+
+        /** -----------------------
+         * set the query parameters
+         * ------------------------
+         */
+        if (queryParams != null) {
+            httpUrl = setQueryParams(httpUrl, queryParams);
+        }
+
+        RequestBuilder requestBuilder = RequestBuilder
+                .create(methodName)
+                .setUri(httpUrl);
+
+        if (reqBodyAsString != null) {
+            HttpEntity httpEntity = EntityBuilder.create()
+                    .setContentType(APPLICATION_JSON)
+                    .setText(reqBodyAsString)
+                    .build();
+            requestBuilder.setEntity(httpEntity);
+        }
+
+        /** --------------
+         * set the headers
+         * ---------------
+         */
+        if (headers != null) {
+            Map headersMap = headers;
+            for (Object key : headersMap.keySet()) {
+                removeDuplicateHeaders(requestBuilder, (String) key);
+                requestBuilder.addHeader((String) key, (String) headersMap.get(key));
+            }
+        }
+
+        /** -----------------------------------------------------------------------------------
+         * Setting cookies:
+         *
+         * Highly discouraged to use sessions, but in case of any server dependent upon session,
+         * then it's taken care here.
+         * ------------------------------------------------------------------------------------
+         */
+        if (COOKIE_JSESSIONID_VALUE != null) {
+            requestBuilder.addHeader("Cookie", (String) COOKIE_JSESSIONID_VALUE);
+        }
+
+        /** ----------------------
+         * now execute the request
+         * -----------------------
+         */
+        CloseableHttpResponse httpResponse = httpclient.execute(requestBuilder.build());
+
+        Response serverResponse = Response
+                .status(httpResponse.getStatusLine().getStatusCode())
+                .entity(IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"))
+                .build();
+
+
+        Header[] allHeaders = httpResponse.getAllHeaders();
+        Response.ResponseBuilder responseBuilder = Response.fromResponse(serverResponse);
+        for (Header thisHeader : allHeaders) {
+            String headerKey = thisHeader.getName();
+            responseBuilder = responseBuilder.header(headerKey, thisHeader.getValue());
+
+            /** ---------------
+             * Session handled
+             * ----------------
+             */
+            if ("Set-Cookie".equals(headerKey)) {
+                COOKIE_JSESSIONID_VALUE = serverResponse.getMetadata().get(headerKey);
+            }
+        }
+        serverResponse = responseBuilder.build();
+
+        return serverResponse;
+    }
+
+    private CloseableHttpClient createSslHttpClient() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException {
+        SSLContext sslContext = new SSLContextBuilder()
+                .loadTrustMaterial(null, (certificate, authType) -> true).build();
+
+        CookieStore cookieStore = new BasicCookieStore();
+
+        CredentialsProvider credsProvider = createProxyCredentialsProvider(proxyHost, proxyPort, proxyUserName, proxyPassword);
+
+        HttpHost proxy = new HttpHost(proxyHost, proxyPort);
+
+        return HttpClients.custom()
+                .setSSLContext(sslContext)
+                .setSSLHostnameVerifier(new NoopHostnameVerifier())
+                .setDefaultCookieStore(cookieStore)
+                .setDefaultCredentialsProvider(credsProvider)
+                .setProxy(proxy)
+                .build();
+    }
+
+    private CredentialsProvider createProxyCredentialsProvider(String proxyHost, int proxyPort, String proxyUserName, String proxyPassword) {
+
+        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+
+        credsProvider.setCredentials(
+                new AuthScope(proxyHost, proxyPort),
+                new UsernamePasswordCredentials(proxyUserName, proxyPassword));
+
+        return credsProvider;
+
+    }
+
+
+    private String setQueryParams(String httpUrl, Map<String, Object> queryParams) {
+        String qualifiedQueryParams = createQualifiedQueryParams(queryParams);
+        httpUrl = httpUrl + qualifiedQueryParams;
+        return httpUrl;
+    }
+
+    private String createQualifiedQueryParams(Object queryParams) {
+        String qualifiedQueryParam = "?";
+        Map queryParamsMap = HelperJsonUtils.readHeadersAsMap(queryParams);
+        for (Object key : queryParamsMap.keySet()) {
+            if ("?".equals(qualifiedQueryParam)) {
+                qualifiedQueryParam = qualifiedQueryParam + format("%s=%s", key, queryParamsMap.get(key));
+            } else {
+                qualifiedQueryParam = qualifiedQueryParam + format("&%s=%s", key, queryParamsMap.get(key));
+            }
+        }
+        return qualifiedQueryParam;
+    }
+
+    private void removeDuplicateHeaders(RequestBuilder requestBuilder, String key) {
+        if(requestBuilder.getFirstHeader(key) != null) {
+            requestBuilder.removeHeaders(key);
+        }
+    }
+}
+
diff --git a/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustHttpClient.java b/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustHttpClient.java
index 24ba6841..b21867d2 100644
--- a/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustHttpClient.java
+++ b/src/main/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustHttpClient.java
@@ -74,6 +74,7 @@ public class SslTrustHttpClient implements BasicHttpClient {
         if (headers != null) {
             Map headersMap = headers;
             for (Object key : headersMap.keySet()) {
+                removeDuplicateHeaders(requestBuilder, (String) key);
                 requestBuilder.addHeader((String) key, (String) headersMap.get(key));
             }
         }
@@ -120,6 +121,12 @@ public class SslTrustHttpClient implements BasicHttpClient {
         return serverResponse;
     }
 
+    private void removeDuplicateHeaders(RequestBuilder requestBuilder, String key) {
+        if(requestBuilder.getFirstHeader(key) != null) {
+            requestBuilder.removeHeaders(key);
+        }
+    }
+
     private CloseableHttpClient createSslHttpClient() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException {
         SSLContext sslContext = new SSLContextBuilder()
                 .loadTrustMaterial(null, (certificate, authType) -> true).build();
diff --git a/src/main/java/org/jsmart/zerocode/core/logbuilder/LogCorrelationshipPrinter.java b/src/main/java/org/jsmart/zerocode/core/logbuilder/LogCorrelationshipPrinter.java
index eec727df..842a30d8 100644
--- a/src/main/java/org/jsmart/zerocode/core/logbuilder/LogCorrelationshipPrinter.java
+++ b/src/main/java/org/jsmart/zerocode/core/logbuilder/LogCorrelationshipPrinter.java
@@ -9,6 +9,7 @@ import java.time.LocalDateTime;
 import java.util.UUID;
 
 import static java.lang.String.format;
+import static java.time.LocalDateTime.now;
 import static org.jsmart.zerocode.core.domain.reports.ZeroCodeReportProperties.RESULT_FAIL;
 import static org.jsmart.zerocode.core.domain.reports.ZeroCodeReportProperties.RESULT_PASS;
 import static org.jsmart.zerocode.core.domain.reports.ZeroCodeReportProperties.TEST_STEP_CORRELATION_ID;
@@ -54,6 +55,8 @@ public class LogCorrelationshipPrinter {
 
     public ZeroCodeReportStep buildReportSingleStep() {
 
+        result = result != null ? result : false;
+
         ZeroCodeReportStep zeroCodeReportStep = ZeroCodeReportStepBuilder.newInstance()
                 //.request(requestLogBuilder.request) //TODO
                 //.response(responseLogBuilder.response) //TODO
@@ -99,7 +102,7 @@ public class LogCorrelationshipPrinter {
 
     public static double durationMilliSecBetween(LocalDateTime requestTimeStamp, LocalDateTime responseTimeStamp) {
 
-        Duration dur = Duration.between(requestTimeStamp, responseTimeStamp);
+        Duration dur = Duration.between(requestTimeStamp, responseTimeStamp != null ? responseTimeStamp : now());
         return dur.toMillis();
     }
 
diff --git a/src/main/java/org/jsmart/zerocode/core/report/ZeroCodeReportGeneratorImpl.java b/src/main/java/org/jsmart/zerocode/core/report/ZeroCodeReportGeneratorImpl.java
index e83e48c6..923d8b2b 100644
--- a/src/main/java/org/jsmart/zerocode/core/report/ZeroCodeReportGeneratorImpl.java
+++ b/src/main/java/org/jsmart/zerocode/core/report/ZeroCodeReportGeneratorImpl.java
@@ -236,10 +236,11 @@ public class ZeroCodeReportGeneratorImpl implements ZeroCodeReportGenerator {
         try {
             writer.writeValue(
                     new File(TARGET_FULL_REPORT_DIR +
-                            TARGET_FULL_REPORT_CSV_FILE_NAME +
-                            "_" +
-                            LocalDateTime.now().toString().replace(":", "-") +
-                            ".csv"),
+                            TARGET_FULL_REPORT_CSV_FILE_NAME
+                            //"_" +
+                            //LocalDateTime.now().toString().replace(":", "-") +
+                            //".csv"
+                    ),
                     zeroCodeCsvReportRows);
 
         } catch (IOException e) {
@@ -312,11 +313,18 @@ public class ZeroCodeReportGeneratorImpl implements ZeroCodeReportGenerator {
             return name.endsWith(".json");
         });
 
-        final List<String> fileNames = ofNullable(Arrays.asList(files)).orElse(emptyList()).stream()
-                .map(thisFile -> thisFile.getAbsolutePath())
-                .collect(Collectors.toList());
+        if(files == null || files.length == 0){
+
+            LOGGER.error("\n\t\t\t************\nNow files were found in folder:{}, hence could not proceed. " +
+                    "\n(If this was intentional, then you can safely ignore this error)" +
+                    " \n\t\t\t************** \n\n", folderName);
+            return emptyList();
 
-        return fileNames;
+        } else {
+            return ofNullable(Arrays.asList(files)).orElse(emptyList()).stream()
+                    .map(thisFile -> thisFile.getAbsolutePath())
+                    .collect(Collectors.toList());
+        }
     }
 
     protected void validateReportsFolderAndTheFilesExists(String reportsFolder) {
@@ -335,8 +343,10 @@ public class ZeroCodeReportGeneratorImpl implements ZeroCodeReportGenerator {
                     "   2) You have simply used @RunWith(...) and ignored all tests -or- \n" +
                     "   3) Permission issue to create/write folder/files \n" +
                     "   4) Please fix it by adding/activating at least one test case or fix the file permission issue\n" +
+                    "   5) If you are not concerned about reports, you can safely ignore this\n" +
                     "----------------------------------------------------------------------------------------\n";
 
+            // TODO- Can Suppress as this error as this is only related to report. It doesn't hurt or affect the tests at all.
             throw new RuntimeException(message);
         }
 
diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
index 960b6c78..47403576 100644
--- a/src/main/resources/logback.xml
+++ b/src/main/resources/logback.xml
@@ -4,7 +4,7 @@
 		<file>target/logs/zerocode_rest_bdd_logs.log</file>
 		<append>true</append>
 		<encoder>
-			<pattern>%d [%thread] %-5level %logger{35} - %msg%n</pattern>
+			<pattern>%d [%thread] %-5level %logger{100} - %msg%n</pattern>
 		</encoder>
 	</appender>
 
@@ -13,7 +13,7 @@
 			<pattern>%d [%thread] %-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
 		</encoder>-->
 		<layout class="ch.qos.logback.classic.PatternLayout">
-			<pattern>%d %green([%thread]) %highlight(%level) %logger{50} - %blue(%msg%n)</pattern>
+			<pattern>%d %green([%thread]) %highlight(%level) %logger{100} - %blue(%msg%n)</pattern>
 		</layout>
 	</appender>
 


Test patch:
diff --git a/src/test/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustCorporateProxyHttpClientTest.java b/src/test/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustCorporateProxyHttpClientTest.java
new file mode 100644
index 00000000..96d5933b
--- /dev/null
+++ b/src/test/java/org/jsmart/zerocode/core/httpclient/ssl/SslTrustCorporateProxyHttpClientTest.java
@@ -0,0 +1,22 @@
+package org.jsmart.zerocode.core.httpclient.ssl;
+
+import org.jsmart.zerocode.core.domain.JsonTestCase;
+import org.jsmart.zerocode.core.domain.TargetEnv;
+import org.jsmart.zerocode.core.domain.UseHttpClient;
+import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@UseHttpClient(SslTrustCorporateProxyHttpClient.class)
+@TargetEnv("soap_host_with_corp_proxy.properties")
+@RunWith(ZeroCodeUnitRunner.class)
+public class SslTrustCorporateProxyHttpClientTest {
+
+    @Ignore("this is only a usage example using dummy proxy details")
+    @Test
+    @JsonTestCase("01_verification_test_cases/21_ssl_trust.json")
+    public void testASmartTestCase_createUpdate() throws Exception {
+
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/org/jsmart/zerocode/core/soap/SoapCorpProxySslHttpClientTest.java b/src/test/java/org/jsmart/zerocode/core/soap/SoapCorpProxySslHttpClientTest.java
index 781aafea..6120d0d5 100644
--- a/src/test/java/org/jsmart/zerocode/core/soap/SoapCorpProxySslHttpClientTest.java
+++ b/src/test/java/org/jsmart/zerocode/core/soap/SoapCorpProxySslHttpClientTest.java
@@ -12,7 +12,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 @UseHttpClient(SoapCorporateProxySslHttpClient.class)
-@TargetEnv("soap_host_with_corp_proxy.properties")
+@TargetEnv("host_with_corp_proxy.properties")
 @RunWith(ZeroCodeUnitRunner.class)
 public class SoapCorpProxySslHttpClientTest {
 
diff --git a/src/test/resources/host_with_corp_proxy.properties b/src/test/resources/host_with_corp_proxy.properties
new file mode 100755
index 00000000..4c1263fe
--- /dev/null
+++ b/src/test/resources/host_with_corp_proxy.properties
@@ -0,0 +1,11 @@
+#
+restful.application.endpoint.host=https://soap-server.co.uk/ServiceName
+restful.application.endpoint.port=443
+
+# Google Map Service Context
+restful.application.endpoint.context=
+
+corporate.proxy.host=example.proxy.corp.co.uk
+corporate.proxy.port=80
+corporate.proxy.username=APPLEORANGE
+corporate.proxy.password=can3eat
diff --git a/src/test/resources/web_app.properties b/src/test/resources/web_app.properties
index 0230e83d..1cfbabdc 100644
--- a/src/test/resources/web_app.properties
+++ b/src/test/resources/web_app.properties
@@ -1,9 +1,10 @@
 # Web Server host and port
 restful.application.endpoint.host=http://localhost
-restful.application.endpoint.port=8888
+restful.application.endpoint.port=8889
 
 # Web Service context; Leave it blank in case you do not have a common context
 restful.application.endpoint.context=
 
 # WireMock will use this port for mocking dependent end points
-mock.api.port=8888
\ No newline at end of file
+mock.api.port=8889
+#mock.api.port=8888 # Tensor Flow - Jupyter runs at 8888 during Python linear regression.
\ No newline at end of file