Package com.ean.wsapi.hotel.v3

Examples of com.ean.wsapi.hotel.v3.Room


        calendar.add(Calendar.DATE, 1);
        final Date afterTomorrow = calendar.getTime();

        final DateFormat format = new SimpleDateFormat("MM/dd/YYYY");

        final HotelListResponse response =
                Expedia.getHotelList()
                        .locale(LocaleType.EN_US)
                        .currency("USD")
                        .customer(uuid, uuid, uuid)
                        .dates(
                                format.format(tomorrow),
                                format.format(afterTomorrow))
                        .room(1)
                        .searchByHotelIdList(152560, 127092)
                        .numberOfResults(20)
                        .include(false, false)
                        .call();

        assertThat("Customer session IDs should be the same.",
                response.getCustomerSessionId(), is(equalTo(uuid)));
        assertThat("Hotel list should exists.",
                response.getHotelList(), is(notNullValue()));
        assertThat("Hotel summary should exists.",
                response.getHotelList().getHotelSummary().size(),
                is(equalTo(2)));
    }
View Full Code Here


        calendar.add(Calendar.DATE, 1);
        final Date afterTomorrow = calendar.getTime();

        final DateFormat format = new SimpleDateFormat("MM/dd/YYYY");

        final HotelListResponse response =
                Expedia.getHotelList()
                        .locale(LocaleType.EN_US)
                        .currency("USD")
                        .customer(uuid, uuid, uuid)
                        .dates(
                                format.format(tomorrow),
                                format.format(afterTomorrow))
                        .room(1)
                        .searchByArea(
                                47.613247f,
                                -122.19644f,
                                5, SearchRadiusUnitType.KM,
                                SortType.NO_SORT
                        )
                        .numberOfResults(20)
                        .include(false, false)
                        .call();

        assertThat("Customer session IDs should be the same.",
                response.getCustomerSessionId(), is(equalTo(uuid)));
        assertThat("Hotel list should exists.",
                response.getHotelList(), is(notNullValue()));
        assertThat("Hotel summary should exists.",
                response.getHotelList().getHotelSummary().size(),
                is(greaterThan(5)));
    }
View Full Code Here

     * Retrieve an instance of the hotel services.
     *
     * @return SOAP implementation of the hotel services
     */
    private HotelServices getHotelServices() {
        return new HotelServicesImplService().getHotelServicesImplPort();
    }
View Full Code Here

    /**
     * An empty constructor with request initialization.
     */
    public GetPingBuilder() {
        request = new PingRequest();
        baseHotelInit(request);
    }
View Full Code Here

     * SOAP service should be used.
     */
    @Test
    public void shouldRetrieveTheSameEcho() throws EanWsException {
        final String echo = UUID.randomUUID().toString();
        final PingResponse response = Expedia.getPing().echo(echo).call();
        assertThat("Echo from response should be equal to input.",
                response.getEcho(), is(equalTo(echo)));

        // SERVER INFO ATTRIBUTES
        final ServerInfo info = response.getServerInfo();
        assertThat("Server time should not be empty.",
                info.getServerTime(), is(notNullValue()));
        assertThat("Timestamp should not be empty.",
                info.getTimestamp(), is(notNullValue()));
        assertThat("Server instance should not be empty.",
View Full Code Here

     *                 For example, to declare that two children ages 5 and 12,
     *                 you would put 5,12.
     * @return a hotel list request builder
     */
    public GetHotelListBuilder room(final int adults, final int... children) {
        final Room room = new Room();
        room.setNumberOfAdults(adults);
        room.setNumberOfChildren(children.length);
        for (int child : children) {
            room.getChildAges().add(child);
        }

        RoomGroup group = request.getRoomGroup();
        if (group == null) {
            group = new RoomGroup();
View Full Code Here

    public void shouldBuildStringWithRoomFormatForREST() {
        final HotelListRequest request = new HotelListRequest();
        final RoomGroup group = new RoomGroup();
        request.setRoomGroup(group);

        final Room room1 = new Room();
        room1.setNumberOfAdults(1);
        group.getRoom().add(room1);

        final StringBuilder builder1 = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder1);
        assertThat("Result strings should be the same.",
                builder1.toString(), is(equalTo("&cid=0&room1=1")));

        final Room room2 = new Room();
        room2.setNumberOfAdults(2);
        room2.setNumberOfChildren(2);
        room2.getChildAges().add(5);
        room2.getChildAges().add(12);
        group.getRoom().add(room2);

        final StringBuilder builder2 = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder2);
        assertThat("Result strings should be the same.",
View Full Code Here

        room.setNumberOfChildren(children.length);
        for (int child : children) {
            room.getChildAges().add(child);
        }

        RoomGroup group = request.getRoomGroup();
        if (group == null) {
            group = new RoomGroup();
            request.setRoomGroup(group);
        }

        group.getRoom().add(room);
        return self();
    }
View Full Code Here

     * a child.
     */
    @Test
    public void shouldBuildStringWithRoomFormatForREST() {
        final HotelListRequest request = new HotelListRequest();
        final RoomGroup group = new RoomGroup();
        request.setRoomGroup(group);

        final Room room1 = new Room();
        room1.setNumberOfAdults(1);
        group.getRoom().add(room1);

        final StringBuilder builder1 = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder1);
        assertThat("Result strings should be the same.",
                builder1.toString(), is(equalTo("&cid=0&room1=1")));

        final Room room2 = new Room();
        room2.setNumberOfAdults(2);
        room2.setNumberOfChildren(2);
        room2.getChildAges().add(5);
        room2.getChildAges().add(12);
        group.getRoom().add(room2);

        final StringBuilder builder2 = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder2);
        assertThat("Result strings should be the same.",
                builder2.toString(),
View Full Code Here

                    error.getPresentationMessage(), is(equalTo(message)));
            assertThat("Verbose messages should be the same.",
                    error.getVerboseMessage(), is(equalTo(message)));

            // SERVER INFO ATTRIBUTES
            final ServerInfo info = error.getServerInfo();
            assertThat("Server time should not be empty.",
                    info.getServerTime(), is(notNullValue()));
            assertThat("Timestamp should not be empty.",
                    info.getTimestamp(), is(notNullValue()));
            assertThat("Server instance should not be empty.",
                    info.getInstance(), is(notNullValue()));
        }
    }
View Full Code Here

TOP

Related Classes of com.ean.wsapi.hotel.v3.Room

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.