package org.funtimecoding.java.skeleton;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class JavaSkeletonMainTest {
    @Test
    public void testRun() {
        JavaSkeletonMain application = new JavaSkeletonMain();
        assertEquals(0, application.run());
    }
}

@@ -46,44 +46,178 @@
 ort 
-static org.junit.Assert.assertEquals
+org.hamcrest.CoreMatchers;%0Aimport org.junit.Test;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0Aimport java.net.HttpURLConnection;%0Aimport java.net.URL
 ;%0A%0Ai
@@ -214,32 +214,39 @@
 et.URL;%0A%0Aimport 
+static 
 org.junit.Test;%0A
@@ -239,20 +239,24 @@
 g.junit.
-Test
+Assert.*
 ;%0A%0Apubli
@@ -436,11 +436,1038 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testGet() %7B%0A        try %7B%0A            URL locator = new URL(%22http://example.org%22);%0A            HttpURLConnection connection = (HttpURLConnection) locator.openConnection();%0A            connection.setRequestMethod(%22GET%22);%0A            assertEquals(200, connection.getResponseCode());%0A            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));%0A            String line;%0A            StringBuilder buffer = new StringBuilder();%0A%0A            while ((line = reader.readLine()) != null) %7B%0A                buffer.append(line);%0A            %7D%0A%0A            reader.close();%0A            assertNotEquals(%22%22, buffer.toString());%0A            assertThat(buffer.toString(), CoreMatchers.containsString(%22Example Domain%22));%0A            // TODO: This leads to OutOfMemoryError when running mvn test. How to compare entire buffer content?%0A            //assertEquals(%22test%22, buffer.toString());%0A        %7D catch (Exception e) %7B%0A            fail(e.getMessage());%0A        %7D%0A    %7D
 %0A%7D%0A

add http get example test