package com.wutiarn.flibustabot.service;

import com.wutiarn.flibustabot.model.opds.BookSearchResult;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
public class FlibustaServiceTests {

	@Autowired
    public FlibustaService flibustaService;

	@Test
	public void bookSearch() {
		BookSearchResult result = flibustaService.search("1984", FlibustaService.SearchType.BOOKS);
	}

}

@@ -95,16 +95,41 @@
 Result;%0A
+import org.junit.Assert;%0A
 import o
@@ -139,24 +139,24 @@
 junit.Test;%0A
-
 import org.j
@@ -444,17 +444,20 @@
 ests %7B%0A%0A
-%09
+    
 @Autowir
@@ -508,16 +508,22 @@
 e;%0A%0A
-%09
+    
 @Test%0A
-%09
+    
 publ
@@ -549,10 +549,16 @@
 ) %7B%0A
-%09%09
+        
 Book
@@ -607,12 +607,18 @@
 ch(%22
-1984
+%D0%B0%D0%B2%D1%82%D0%BE%D1%81%D1%82%D0%BE%D0%BF%D0%BE%D0%BC
 %22, F
@@ -655,9 +655,302 @@
 S);%0A
-%09
+        Assert.assertNotNull(result.id);%0A        Assert.assertNotNull(result.title);%0A        Assert.assertNotNull(result.entry);%0A%0A        Assert.assertTrue(result.entry.size() %3E 1);%0A        Assert.assertNotNull(result.entry.get(0).id);%0A        Assert.assertNotNull(result.entry.get(1).id);%0A    
 %7D%0A%0A%7D

Update search test