Exemplo n.º 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);
    }
  }
Exemplo n.º 2
0
  /**
   * Test of getInfo method, of class OmdbApi.
   *
   * @throws OMDBException
   */
  @Test
  public void testMovieInfo_ByName() throws OMDBException {
    LOG.info("movieInfo_ByName");

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