Project Structure
/spp-test-automation
/src
/main
/test
/java
/com.testing.tool
Processor.java
/resources
processor.json
Within Processor.java
I am trying to grab the contents in my processor.json
file. However, I am getting a NullPointerException
and I am not sure why.
For the variable filepath
, I've tried the values "src/test/resources/procesoosr.json"
, "processor.json"
, "\processor.json"
but I am still getting a NullPointerException
.
BufferedReader bufferedReader = new BufferedReader(new FileReader(filepath));
I have even passing in the absolute path but I get the same error as well.
File file = new File("src/test/resources/processor.json");
String absolutePath = file.getAbsolutePath();
I am using Intellij to run these tests and this is what my config looks like. Ignore the red text and I simply renamed the package but the concept is essentially the same