Beispiel #1
0
  /**
   * Test of getInfo method, of class OmdbApi.
   *
   * @throws OMDBException
   */
  @Test
  public void testMovieInfo_4args() throws OMDBException {
    LOG.info("movieInfo - All args");
    OmdbVideoFull result = null;

    for (TestID test : IDS) {
      LOG.info("Testing: '{}'", test.getTitle());

      result =
          omdb.getInfo(
              new OmdbBuilder()
                  .setTitle(test.getTitle())
                  .setYear(test.getYear())
                  .setPlotLong()
                  .setTomatoes(true)
                  .build());

      assertNotNull("Null object returned", result);
      assertTrue("Error with call", result.isResponse());
      assertEquals("Wrong video returned", test.getImdb(), result.getImdbID());
      assertTrue("No RT data", StringUtils.isNotBlank(result.getTomatoConsensus()));
    }

    try {
      result =
          omdb.getInfo(new OmdbBuilder().setTitle("Some movie that can't be found at all").build());
      assertFalse("What do you mean this was found?", result.isResponse());
    } catch (OMDBException ex) {
      assertNotNull("Null object returned", result);
    }
  }
Beispiel #2
0
  /**
   * Test of getInfo method, of class OmdbApi.
   *
   * @throws OMDBException
   */
  @Test
  public void testMovieInfo_ByTT() throws OMDBException {
    LOG.info("movieInfo_ByTT");

    for (TestID test : IDS) {
      LOG.info("Testing: '{}'", test.getTitle());
      OmdbVideoFull result = omdb.getInfo(new OmdbBuilder().setImdbId(test.getImdb()).build());
      assertEquals("Wrong movie returned", test.getTitle(), result.getTitle());
    }
  }