package com.heroku.api.request;

import com.heroku.api.Heroku;
import com.heroku.api.request.log.LogStreamResponse;
import org.testng.annotations.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

public class LogStreamResponseTest {

    @Test
    public void testLogStream() throws IOException {
        LogStreamResponse response = new LogStreamResponse(new URL(Heroku.Config.ENDPOINT.value));
        BufferedReader reader = new BufferedReader(new InputStreamReader(response.openStream()));
        String line = "";
        while (line != null) {
            System.out.println(line);
            line = reader.readLine();
        }

    }
}

@@ -165,84 +165,19 @@
 .io.
-BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader
+IOException
 ;%0Aim
@@ -408,241 +408,38 @@
     
-BufferedReader reader = new BufferedReader(new InputStreamReader(response.openStream()));%0A        String line = %22%22;%0A        while (line != null) %7B%0A            System.out.println(line);%0A            line = reader.readLine();%0A        %7D%0A
+response.openStream().close();
 %0A   

refactor test so that it dosent hang the build if there isnt any logplex output