package br.ufu.renova.scraper;

import java.io.IOException;
import java.util.*;

/**
 * Created by yassin on 10/19/16.
 */
public class MockHttpClient implements IHttpClient {

    @Override
    public List<Book> getBooks() {
        Calendar tomorrow = Calendar.getInstance();
        tomorrow.add(Calendar.DAY_OF_MONTH, 1);

        Book b1 = new Book();
        b1.setTitle("Effective Java");
        b1.setAuthors("Joshua Bloch");
        b1.setBarcode("123456789");
        b1.setExpiration(tomorrow.getTime());

        Book b2 = new Book();
        b2.setTitle("Machine Learning");
        b2.setAuthors("Tom M. Mitchell");
        b2.setBarcode("987654321");
        b2.setExpiration(tomorrow.getTime());

        Book[] books = {b1, b2};
        return Arrays.asList(books);
    }

    @Override
    public void renew(Book b) throws RenewDateException, BookReservedException, IOException {
        Calendar nextWeek = Calendar.getInstance();
        nextWeek.setTime(b.getExpiration());
        nextWeek.add(Calendar.DAY_OF_MONTH, 7);
        b.setExpiration(nextWeek.getTime());
        b.setState(Book.State.RENEWED);
    }
}

@@ -178,48 +178,56 @@
     
-@Override%0A    public List%3CBook%3E getBooks
+private Book%5B%5D books;%0A%0A    public MockHttpClient
 () %7B
@@ -722,23 +722,16 @@
 %0A       
- Book%5B%5D
  books =
@@ -735,17 +735,83 @@
 s = 
-%7Bb1, b2%7D;
+new Book%5B%5D%7Bb1, b2%7D;%0A    %7D%0A%0A    @Override%0A    public List%3CBook%3E getBooks() %7B
 %0A   
@@ -1145,24 +1145,24 @@
 getTime());%0A
-
         b.se
@@ -1189,16 +1189,149 @@
 NEWED);%0A
+        try %7B%0A            Thread.sleep(1000l);%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A
     %7D%0A%7D%0A

Fix bug ao criar novas instâncias no getBooks. Adicionando sleep para se poder ver as animações.