package com.twu.biblioteca;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;

public class BibliotecaAppTest {
    private ByteArrayOutputStream outputStream;

    @Before
    public void setUp() {
        outputStream = new ByteArrayOutputStream();
        System.setOut(new PrintStream(outputStream));
    }

    @Test
    public void shouldDisplayWelcomeMessageOnAppStart() {
        BibliotecaApp bibliotecaApp = new BibliotecaApp();
        bibliotecaApp.welcomeMessage();

        String actual = outputStream.toString();

        assertThat(actual, is("Welcome to Biblioteca\n"));
    }

    @Test
    public void shouldDisplayAListOfBooks() {
        BibliotecaApp bibliotecaApp = new BibliotecaApp();
        bibliotecaApp.displayBooks();

        String actual = outputStream.toString();

        assertThat(actual, is(not("\n")));
    }

    @After
    public void clean() {
        System.setOut(null);
    }
}
@@ -560,23 +560,32 @@
 d should
+BeAbleTo
 Display
+A
 WelcomeM
@@ -718,32 +718,39 @@
    String actual
+Message
  = outputStream.
@@ -783,24 +783,31 @@
 tThat(actual
+Message
 , is(%22Welcom
@@ -867,16 +867,24 @@
 d should
+BeAbleTo
 DisplayA
@@ -984,16 +984,9 @@
 App.
-displayB
+b
 ooks
@@ -1011,16 +1011,27 @@
 g actual
+ListOfBooks
  = outpu
@@ -1076,16 +1076,27 @@
 t(actual
+ListOfBooks
 , is(not

Refactor - rename test methods and local variables in BibliotecaAppTest