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