Examples of CitySearchCriteria


Examples of org.springframework.springfaces.traveladvisor.service.CitySearchCriteria

  @Mock
  private Pageable pageable;

  @Test
  public void shouldFindCitiesByName() throws Exception {
    CitySearchCriteria criteria = new CitySearchCriteria("city");
    given(this.cityRepository.findByNameLikeAndCountryLikeAllIgnoringCase("%city%", "%%", this.pageable))
        .willReturn(this.cities);
    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }
View Full Code Here

Examples of org.springframework.springfaces.traveladvisor.service.CitySearchCriteria

    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }

  @Test
  public void shouldFindCitiesByNameRestrictedToCountry() throws Exception {
    CitySearchCriteria criteria = new CitySearchCriteria("city, country");
    given(this.cityRepository.findByNameLikeAndCountryLikeAllIgnoringCase("%city%", "%country%", this.pageable))
        .willReturn(this.cities);
    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }
View Full Code Here

Examples of org.springframework.springfaces.traveladvisor.service.CitySearchCriteria

    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }

  @Test
  public void shouldFindCitiesByNameRestrictedToCountryWithExtraCommas() throws Exception {
    CitySearchCriteria criteria = new CitySearchCriteria("ci,ty,country");
    given(this.cityRepository.findByNameLikeAndCountryLikeAllIgnoringCase("%ci,ty%", "%country%", this.pageable))
        .willReturn(this.cities);
    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }
View Full Code Here

Examples of org.springframework.springfaces.traveladvisor.service.CitySearchCriteria

    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }

  @Test
  public void shouldFindCitiesByCountry() throws Exception {
    CitySearchCriteria criteria = new CitySearchCriteria(",country");
    given(this.cityRepository.findByNameLikeAndCountryLikeAllIgnoringCase("%%", "%country%", this.pageable))
        .willReturn(this.cities);
    assertThat(this.cityService.findCities(criteria, this.pageable), is(this.cities));
  }
View Full Code Here

Examples of org.springframework.springfaces.traveladvisor.service.CitySearchCriteria

  private static final Pageable PAGEABLE = new PageRequest(0, 30);

  private CityService cityService;

  public List<City> suggest(String name) {
    Page<City> suggestions = cityService.findCities(new CitySearchCriteria(name), PAGEABLE);
    return suggestions.getContent();
  }
View Full Code Here

Examples of org.springframework.springfaces.traveladvisor.service.CitySearchCriteria

  private CityService cityService;

  @RequestMapping("/advisor/cities/search")
  public String enterSearchDetails(Model model) {
    model.addAttribute(new CitySearchCriteria());
    return "citysearch";
  }
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.