Package org.springframework.springfaces.traveladvisor.domain

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


    assertThat(page.getTotalElements(), is(1L));
  }

  @Test
  public void shouldFindByNameAndCountry() throws Exception {
    City melbourneUsa = this.cityRepository.findByNameAndCountryAllIgnoringCase("Melbourne", "USA");
    City melbourneAustralia = this.cityRepository.findByNameAndCountryAllIgnoringCase("Melbourne", "Australia");
    assertThat(melbourneUsa.getName(), is("Melbourne"));
    assertThat(melbourneUsa.getCountry(), is("USA"));
    assertThat(melbourneAustralia.getName(), is("Melbourne"));
    assertThat(melbourneAustralia.getCountry(), is("Australia"));
  }
View Full Code Here


    assertThat(melbourneAustralia.getCountry(), is("Australia"));
  }

  @Test
  public void shouldReturnNullIfNotFoundByNameAndCountry() throws Exception {
    City city = this.cityRepository.findByNameAndCountryAllIgnoringCase("Melbourne", "UK");
    assertThat(city, is(nullValue()));
  }
View Full Code Here

    model.addAttribute("hotel", hotel.getName());
    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

    return "citysearch";
  }

  @NavigationMapping
  public Object onSearch(CitySearchCriteria criteria) {
    City city = findSingleCity(criteria);
    if (city != null) {
      ExtendedModelMap model = new ExtendedModelMap().addAttribute("country", city.getCountry()).addAttribute(
          "name", city.getName());
      return new NavigationOutcome("@showCity", model);
    }
    return "@performSearch";
  }
View Full Code Here

TOP

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

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.