
com.shaft.tools.io.JSONFileManager Maven / Gradle / Ivy
package com.shaft.tools.io;
import io.restassured.path.json.JsonPath;
import io.restassured.path.json.exception.JsonPathException;
import org.testng.Assert;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
public class JSONFileManager {
private final String jsonFilePath;
private FileReader reader = null;
/**
* 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) {
this.jsonFilePath = jsonFilePath;
try {
this.reader = new FileReader(jsonFilePath);
} catch (FileNotFoundException rootCauseException) {
ReportManager.log(rootCauseException);
ReportManager.log("Couldn't find the desired file. [" + jsonFilePath + "].");
Assert.fail("Couldn't find the desired file. [" + jsonFilePath + "].");
}
List> attachments = new ArrayList<>();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy