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