I would like to create a test case to test this catch block
I want to test this message "File does't exit, please put the file inside resources folder."
and FileNotFoundException exception using testNG.
try { //something here
} catch (FileNotFoundException ex) {
System.out.println("File does't exit, please put the file inside resources folder.");
ex.printStackTrace();
}
Try this code, you will get the FileNotFoundException, the file 'test.txt' should not be available in the path: