import org.junit.Test;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;

public class TestHttpRequest
{
    @Test
    public void doTest()throws Exception{
        post("hoge","hoge");
    }
    public String post(String authheader,String url)throws IOException{
        URL urls=new URL(url);
        HttpURLConnection connection=(HttpURLConnection)urls.openConnection();

        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization",authheader);
        connection.connect();
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream(), StandardCharsets.UTF_8));
        writer.write(authheader);
        writer.flush();

        InputStreamReader isr = connection.getResponseCode() == HttpURLConnection.HTTP_OK  ? new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8) : new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8);
        BufferedReader reader = new BufferedReader(isr);
        String line;
        String resultLine = "";
        System.out.println("----- Body -----");
        while((line = reader.readLine()) != null) {
            System.out.println(line);
            resultLine = resultLine + line;
        }
        writer.close();
        reader.close();

        return resultLine;

    }
}

@@ -169,95 +169,8 @@
 t%0A%7B%0A
-    @Test%0A    public void doTest()throws Exception%7B%0A        post(%22hoge%22,%22hoge%22);%0A    %7D%0A
     

Update TestHttpRequest.java