package com.example.javamavenjunithelloworld;

import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.StandardOutputStreamLog;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;


/**
 * Integration test for the HelloApp program.
 * <p/>
 * An integration test verifies the workings of a complete program, a module, or a set of dependant classes.
 * This integration test uses system-rules, an extension for JUnit that lets you test System.out and System.exit()
 * etc
 
 * http://www.stefan-birkner.de/system-rules
 */


public class HelloWithTestsIT {

    @Rule
    public final StandardOutputStreamLog out = new StandardOutputStreamLog();

    @Test
    public void doesItSayHelloTest() {
        String[] args = {"1"};
        HelloApp.main(args);

        assertThat(out.getLog(), is(equalTo(Hello.HELLO + "\n")));
    }

    @Test
    public void doesItSayHelloTest3() {
        String[] args = {"3"};
        HelloApp.main(args);

        String thrice = Hello.HELLO + "\n" + Hello.HELLO + "\n" + Hello.HELLO + "\n";
        assertThat(out.getLog(), is(equalTo(thrice)));
    }
}

@@ -866,16 +866,18 @@
 LLO + %22%5C
+r%5C
 n%22)));%0A 
@@ -1025,32 +1025,34 @@
 Hello.HELLO + %22%5C
+r%5C
 n%22 + Hello.HELLO
@@ -1056,16 +1056,18 @@
 LLO + %22%5C
+r%5C
 n%22 + Hel
@@ -1079,16 +1079,18 @@
 LLO + %22%5C
+r%5C
 n%22;%0A    

Update HelloWithTestsIT.java