mirror of https://github.com/bvn13/imdb-spider.git
commenting tests
parent
b325eab2eb
commit
c52bca15f4
20
core/pom.xml
20
core/pom.xml
|
@ -39,6 +39,26 @@
|
|||
<version>1.11.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.8.6/jackson-core-2.8.6.jar -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.9.8</version>
|
||||
</dependency>
|
||||
<!-- http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.8.6/jackson-annotations-2.8.6.jar -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.9.8</version>
|
||||
</dependency>
|
||||
<!-- http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.8.6/jackson-databind-2.8.6.jar -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.9.8</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package ru.bvn13.imdbspider.runner;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import ru.bvn13.imdbspider.ImdbSpider;
|
||||
|
@ -33,7 +35,7 @@ public class MovieSearchTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSearchTerminator() throws ImdbSpiderException {
|
||||
public void testSearchTerminator() throws ImdbSpiderException, JsonProcessingException {
|
||||
MovieList result = spider.searchMovieByTitle("Terminator", 5,
|
||||
MovieDataType.ID,
|
||||
MovieDataType.TITLE,
|
||||
|
@ -62,6 +64,12 @@ public class MovieSearchTest {
|
|||
Movie movie = result.getMovies().get(0);
|
||||
|
||||
System.out.println("Testing Movie #"+movie.getId()+", url: "+movie.getUrl());
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(result);
|
||||
|
||||
System.out.println("==========================================");
|
||||
System.out.println("MOVIE: \n"+json);
|
||||
System.out.println("==========================================");
|
||||
|
||||
assertTrue("Expected ID field presence", movie.isDataTypeRetrieved(MovieDataType.ID));
|
||||
assertTrue("Expected TITLE field presence", movie.isDataTypeRetrieved(MovieDataType.TITLE));
|
||||
|
|
Loading…
Reference in New Issue