Esempio n. 1
0
  /**
   * Test of build method, of class OmdbApi.
   *
   * @throws OMDBException
   */
  @Test
  public void testSearch_String_int() throws OMDBException {
    LOG.info("Search - Title & Year");
    for (TestID test : IDS) {
      LOG.info("Testing: '{}'", test.getTitle());
      SearchResults result = omdb.search(test.getTitle(), test.getYear());
      assertNotNull("Null search returned", result);
      assertTrue("Error response", result.isResponse());
      assertTrue("No records found", result.getResults().size() > 0);

      boolean found = false;
      for (OmdbVideoBasic movie : result.getResults()) {
        if (StringUtils.equals(test.getImdb(), movie.getImdbID())) {
          found = true;
          break;
        }
      }
      assertTrue("Movie not found in search results", found);
    }
  }
Esempio n. 2
0
 @Test
 public void testSearch() throws OMDBException {
   SearchResults response =
       omdb.search(new OmdbBuilder().setSearchTerm("Star Wars").setYear(1977).build());
   LOG.info(response.toString());
 }