Package org.springframework.springfaces.traveladvisor.domain

Examples of org.springframework.springfaces.traveladvisor.domain.Hotel


  }

  @Test
  public void shouldFindByCityAndName() throws Exception {
    String name = "Bath Travelodge";
    Hotel hotel = this.hotelRepository.findByCityAndName(this.bath, name);
    assertThat(hotel.getName(), is(name));
  }
View Full Code Here


    assertThat(hotel.getName(), is(name));
  }

  @Test
  public void shouldNotFindIfMalfomed() throws Exception {
    Hotel hotel = this.hotelRepository.findByCityAndName(this.bath, "missing");
    assertThat(hotel, is(nullValue()));
  }
View Full Code Here

  private ObjectMessageSource messageSource;

  @RequestMapping("/advisor/{country}/{city}/{name}")
  public String hotel(@PathVariable String country, @PathVariable String city, @PathVariable String name, Model model) {
    Hotel hotel = getHotel(country, city, name);
    model.addAttribute(hotel);
    model.addAttribute("reviewsSummary", toChartModel(this.hotelService.getReviewSummary(hotel)));
    return "hotel";
  }
View Full Code Here

    return new NavigationOutcome("@hotel", model);
  }

  private Hotel getHotel(String country, String cityName, String hotelName) {
    City city = this.cityService.getCity(cityName, country);
    Hotel hotel = this.hotelService.getHotel(city, hotelName);
    return hotel;
  }
View Full Code Here

TOP

Related Classes of org.springframework.springfaces.traveladvisor.domain.Hotel

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.