(InputStream is)
| 34 | public class TestHelper { |
| 35 | |
| 36 | public static String inputStreamToString(InputStream is) throws IOException { |
| 37 | StringWriter sw = new StringWriter(); |
| 38 | |
| 39 | BufferedReader reader = new BufferedReader(new InputStreamReader(is)); |
| 40 | String line; |
| 41 | try { |
| 42 | while ((line = reader.readLine()) != null) { |
| 43 | sw.append(line).append('\n'); |
| 44 | } |
| 45 | return sw.toString(); |
| 46 | } finally { |
| 47 | is.close(); |
| 48 | } |
| 49 | } |
| 50 | } |
no test coverage detected