com.shaft.tools.io.JSONFileManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SHAFT_ENGINE Show documentation
Show all versions of SHAFT_ENGINE Show documentation
SHAFT is a unified test automation engine. Powered by best-in-class frameworks, SHAFT provides a
wizard-like syntax to drive your automation efficiently, maximize your ROI, and minimize your learning curve.
Stop reinventing the wheel. Upgrade now!
package com.shaft.tools.io;
import com.shaft.cli.FileActions;
import com.shaft.driver.DriverFactory;
import com.shaft.tools.internal.support.JavaHelper;
import com.shaft.tools.io.internal.FailureReporter;
import com.shaft.tools.io.internal.ReportManagerHelper;
import io.restassured.path.json.JsonPath;
import io.restassured.path.json.exception.JsonPathException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@SuppressWarnings("unused")
public class JSONFileManager {
private final String jsonFilePath;
private static final ThreadLocal reader = new ThreadLocal<>();
/**
* Creates a new instance of the test data json reader using the target json
* file path
*
* @param jsonFilePath target test data json file path
*/
public JSONFileManager(String jsonFilePath) {
DriverFactory.reloadProperties();
jsonFilePath = JavaHelper.appendTestDataToRelativePath(jsonFilePath);
this.jsonFilePath = jsonFilePath;
initializeReader();
List> attachments = new ArrayList<>();
List