@Test
 public void testConsume() throws Exception {
   Cancellation cancellation =
       cancellationRequest.consume(JSONFileUtil.loadJsonFromFile("valid-cancellation.json"));
   assertNotNull(cancellation);
   assertEquals("12345678", cancellation.cancellationNumber);
 }
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);
  }
Esempio n. 3
0
 @Test(expected = EanWsError.class)
 public void testConsumeEanWsError() throws Exception {
   itineraryRequest.consume(JSONFileUtil.loadJsonFromFile("error-itinerary.json"));
 }
Esempio n. 4
0
 @Test(expected = JSONException.class)
 public void testConsumeInvalidJson() throws Exception {
   itineraryRequest.consume(JSONFileUtil.loadJsonFromFile("invalid-itinerary.json"));
 }
 @Test(expected = EanWsError.class)
 public void testConsumeEanWsError() throws Exception {
   cancellationRequest.consume(JSONFileUtil.loadJsonFromFile("error-cancellation.json"));
 }
 @Test(expected = JSONException.class)
 public void testConsumeInvalidJson() throws Exception {
   cancellationRequest.consume(JSONFileUtil.loadJsonFromFile("invalid-cancellation.json"));
 }