Examples of HotelListRequest


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

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

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

     * Verify that api key was converted.
     */
    @Test
    public void shouldBuildStringWithApiKey()
            throws UnsupportedEncodingException {
        final HotelListRequest request = new HotelListRequest();
        request.setApiKey("apiKey");
        final StringBuilder builder = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder);
        assertThat("Result strings should be the same.",
                builder.toString(), is(equalTo("&apiKey=apiKey&cid=0")));
    }
View Full Code Here

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

     * Verify that locale was converted correctly.
     */
    @Test
    public void shouldBuildStringWithLocale()
            throws UnsupportedEncodingException {
        final HotelListRequest request = new HotelListRequest();
        request.setLocale(LocaleType.EN_US);
        final StringBuilder builder = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder);
        assertThat("Result strings should be the same.",
                builder.toString(), is(equalTo("&cid=0&locale=en_US")));
    }
View Full Code Here

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

     * for the number of children - each age value is assumed to belong to
     * 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(),
                is(equalTo("&cid=0&room1=1&room2=2,5,12")));

    }
View Full Code Here

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

     * Verify that array was converted.
     */
    @Test
    public void shouldBuildStringWithArray()
            throws UnsupportedEncodingException {
        final HotelListRequest request = new HotelListRequest();
        request.getHotelIdList().add((long) 1);
        request.getHotelIdList().add((long) 2);
        final StringBuilder builder = new StringBuilder();
        JsonFormBodyWriter.writeTo(request.getClass(), request, builder);
        assertThat("Result strings should be the same.",
                builder.toString(), is(equalTo("&cid=0&hotelIdList=1,2,")));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.