Esempio n. 1
0
  private void doHotelConfirmationAssertions(
      final List<Itinerary.HotelConfirmation> hotelConfirmations) {
    assertNotNull(hotelConfirmations);
    assertThat(hotelConfirmations.size(), greaterThan(0));

    Itinerary.HotelConfirmation hotelConfirmation = hotelConfirmations.get(0);
    assertNotNull(hotelConfirmation);
    assertEquals("7220", hotelConfirmation.roomTypeCode);
    assertEquals(SupplierType.EXPEDIA, hotelConfirmation.supplierType);
    assertEquals(ConfirmationStatus.CONFIRMED, hotelConfirmation.status);
    assertEquals(DateModifier.getDateFromString("02/07/2013"), hotelConfirmation.arrivalDate);
    assertEquals(DateModifier.getDateFromString("02/10/2013"), hotelConfirmation.departureDate);
    assertEquals(CommonParameters.locale, hotelConfirmation.locale);
    assertEquals("1234", hotelConfirmation.confirmationNumber);
    assertEquals("N", hotelConfirmation.smokingPreference);
    assertEquals("7220", hotelConfirmation.rateCode);
    assertEquals(1, hotelConfirmation.occupancy.numberOfAdults);
    assertThat(hotelConfirmation.occupancy.childAges.size(), equalTo(0));
    assertEquals(
        "7-Day Advance Purchase Special (on select nights)", hotelConfirmation.rateDescription);
    assertEquals("EP", hotelConfirmation.chainCode);
    assertEquals(3, hotelConfirmation.nights);
    assertEquals("Queen of Art", hotelConfirmation.roomDescription);
    assertEquals("test", hotelConfirmation.guestName.first);
    assertEquals("tester", hotelConfirmation.guestName.last);

    doRateAssertions(hotelConfirmation.rate);
  }
Esempio n. 2
0
  @Test
  public void testConsume() throws Exception {
    Itinerary itinerary =
        itineraryRequest.consume(JSONFileUtil.loadJsonFromFile("valid-itinerary.json"));
    assertNotNull(itinerary);
    assertEquals(107730857L, itinerary.id);
    assertEquals(CommonParameters.cid, String.valueOf(itinerary.affiliateId));
    assertEquals(DateModifier.getDateFromString("01/28/2013"), itinerary.creationDate);
    assertEquals(DateModifier.getDateFromString("02/07/2013"), itinerary.itineraryStartDate);
    assertEquals(DateModifier.getDateFromString("02/10/2013"), itinerary.itineraryEndDate);

    doCustomerAssertions(itinerary.customer);
    doHotelConfirmationAssertions(itinerary.hotelConfirmations);
  }