diff options
Diffstat (limited to 'src/test/java/org/onap/aai/sa/rest/TestUtils.java')
-rw-r--r-- | src/test/java/org/onap/aai/sa/rest/TestUtils.java | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/src/test/java/org/onap/aai/sa/rest/TestUtils.java b/src/test/java/org/onap/aai/sa/rest/TestUtils.java index 503e808..e990438 100644 --- a/src/test/java/org/onap/aai/sa/rest/TestUtils.java +++ b/src/test/java/org/onap/aai/sa/rest/TestUtils.java @@ -29,35 +29,34 @@ import java.io.IOException; public class TestUtils { - /** - * This helper method reads the contents of a file into a - * simple string. - * - * @param aFile - The file to be imported. - * - * @return - The file contents expressed as a simple string. - * - * @throws IOException - */ - public static String readFileToString(File aFile) throws IOException { + /** + * This helper method reads the contents of a file into a simple string. + * + * @param aFile - The file to be imported. + * + * @return - The file contents expressed as a simple string. + * + * @throws IOException + */ + public static String readFileToString(File aFile) throws IOException { - BufferedReader br = new BufferedReader(new FileReader(aFile)); - try { - StringBuilder sb = new StringBuilder(); - String line = br.readLine(); + BufferedReader br = new BufferedReader(new FileReader(aFile)); + try { + StringBuilder sb = new StringBuilder(); + String line = br.readLine(); - while (line != null) { - sb.append(line); - line = br.readLine(); - } + while (line != null) { + sb.append(line); + line = br.readLine(); + } - return sb.toString().replaceAll("\\s+", ""); - } finally { - try { - br.close(); - } catch (IOException e) { - fail("Unexpected IOException: " + e.getMessage()); - } + return sb.toString().replaceAll("\\s+", ""); + } finally { + try { + br.close(); + } catch (IOException e) { + fail("Unexpected IOException: " + e.getMessage()); + } + } } - } -}
\ No newline at end of file +} |