Got the solution for this, I just created the file in the resource folder with the same file name and added dummy text to it. So that when the scanner statement gets executed in the test case it will read the dummy file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…