X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fsa%2Frest%2FTestUtils.java;h=e9904381e18b48d8a0e72f7e9198104186205dc8;hb=15af66b115f3e8046b2d0f2634fb77b3d835f730;hp=503e808c862cf974006ebd1e5d69799b4f1bab7a;hpb=71393bb2bf9fb10962723e61cf0e70d9aa202645;p=aai%2Fsearch-data-service.git 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 +}