package cl.fatman.capital.fund;

import static org.junit.Assert.*;

import java.time.LocalDate;

import org.junit.Test;

public class ExtractFundDataTest {

	@Test
	public void getFundDataTest() {
		ExtractFundData efData = new ExtractFundData("blabla");
		assertNotNull("List with Fund data should not be null", efData.getFundData());
	}
	
	
	@Test
	public void getFundRateDataTest() {
		ExtractFundData efData = new ExtractFundData("blabla");
		LocalDate frDate = LocalDate.now();
		assertNotNull("List with Fund Rate data should not be null", efData.getFundRateData(frDate));
	}
}

@@ -60,16 +60,97 @@
 sert.*;%0A
+import org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;
 %0Aimport 
@@ -175,32 +175,8 @@
 e;%0A%0A
-import org.junit.Test;%0A%0A
 publ
@@ -206,23 +206,75 @@
 aTest %7B%0A
+%09
 %0A%09
-@Test
+private static ExtractFundData efData;%0A%09%0A%09%0A%09@BeforeClass
 %0A%09public
@@ -278,90 +278,413 @@
 lic 
+static 
 void 
-getFundDataTest() %7B%0A%09%09ExtractFundData efData = new ExtractFundData(%22blabla%22);
+setUp() %7B%0A%09%09String link = %22http://www.aafm.cl/tecnoera/index.php?clase=informe&metodo=rentabilidad_html&inversion=%25&administradora=%25&tipo=%22;%0A%09%09String userAgent = %22Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36%22;%0A%09%09efData = new ExtractFundData(link, userAgent);%0A%09%7D%0A%09%0A%09%0A%09@Test%0A%09public void getFundDataTest() throws IOException %7B
 %0A%09%09a
@@ -757,16 +757,17 @@
 undData(
+1
 ));%0A%09%7D%0A%09
@@ -761,32 +761,34 @@
 ata(1));%0A%09%7D%0A%09%0A%09%0A
+%09%0A
 %09@Test%0A%09public v
@@ -819,66 +819,8 @@
 ) %7B%0A
-%09%09ExtractFundData efData = new ExtractFundData(%22blabla%22);%0A
 %09%09Lo

Improve junit code and design.