String (final String filePath) { Assert.assertTrue(filePath.endsWith(".groovy")); String testFilePath = StringUtil.trimEnd(filePath, "groovy") + "test"; final File file = new File(getTestDataPath() + testFilePath); assertTrue(file.exists()); String expected = ""; try { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); while (line != null) { expected += line; line = reader.readLine(); if (line != null) expected += "\n"; } reader.close(); } catch (IOException e) { e.printStackTrace(); } return expected; }