I want to read html template from resources folder into JUnit file. I tried this:
String resourceName = "templates/account_confirmation.html";
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(resourceName).getFile());
String content = Files.readString(file.toPath(), StandardCharsets.UTF_8);
I get error:
java: cannot find symbol
symbol: method readString(java.nio.file.Path,java.nio.charset.Charset)
location: class java.nio.file.Files
Do you know how I can fix this issue?