@Test
public void whenReadSmallFileJava7_thenCorrect()
  throws IOException {
    String expected_value = "Hello, world!";

    Path path = Paths.get("src/test/resources/fileTest.txt");

    String read = Files.readAllLines(path).get(0);
    assertEquals(expected_value, read);
}

Files를 이용하면 쉽게 파일 전체를 읽을 수 있다.

https://www.baeldung.com/reading-file-in-java