@Test(groups = "findStateByAbbreviation", dependsOnGroups = "findStates") public void findStateByAbbreviation() { State state = stateService.findStateByAbbreviation("KY"); assert state != null; }
protected List<State> populateStates() { return stateService.findStates(); }
public void createState() { State state = new StateImpl(); state.setAbbreviation("KY"); state.setName("Kentucky"); state.setCountry(countryService.findCountryByAbbreviation("US")); stateService.save(state); }
state.setCountry(country); stateService.save(state);
@Override public void setAsText(String text) { if (StringUtils.isNotEmpty(text)) { State state = stateService.findStateByAbbreviation(text); setValue(state); } else { setValue(null); } } });
@Deprecated public List<State> getStateOptions() { return stateService.findStates(); }
state.setCountry(country); state = stateService.save(state);
/** * This method only exists because so many other tests depend on it, but should be removed once tests are more isolated * @param customerAddress */ @Deprecated @Test(groups = "createCustomerAddress", dataProvider = "setupCustomerAddress", dataProviderClass = CustomerAddressDataProvider.class, dependsOnGroups = {"readCustomer", "createCountry", "createState"}) @Transactional @Rollback(false) public void createCustomerAddress(CustomerAddress customerAddress) { userName = "customer1"; Customer customer = customerService.readCustomerByUsername(userName); assert customerAddress.getId() == null; customerAddress.setCustomer(customer); State state = stateService.findStateByAbbreviation("KY"); customerAddress.getAddress().setState(state); Country country = countryService.findCountryByAbbreviation("US"); customerAddress.getAddress().setCountry(country); customerAddress.getAddress().setIsoCountrySubdivision("US-KY"); ISOCountry isoCountry = isoService.findISOCountryByAlpha2Code("US"); customerAddress.getAddress().setIsoCountryAlpha2(isoCountry); customerAddress = customerAddressService.saveCustomerAddress(customerAddress); assert customer.equals(customerAddress.getCustomer()); userId = customerAddress.getCustomer().getId(); }
/** * Renders the add address form during the multiship process * * @param request * @param response * @param model * @return the return path */ public String showMultishipAddAddress(HttpServletRequest request, HttpServletResponse response, Model model) { model.addAttribute("states", stateService.findStates()); model.addAttribute("countries", countryService.findCountries()); model.addAttribute("countrySubdivisions", countrySubdivisionService.findSubdivisions()); return getMultishipAddAddressView(); }
state.setCountry(country); state = stateService.save(state);
/** * Saves a customerAddress with state KY and country US. Requires that createCountry() and createState() have been called * @param customerAddress */ public CustomerAddress saveCustomerAddress(CustomerAddress customerAddress) { State state = stateService.findStateByAbbreviation("KY"); customerAddress.getAddress().setState(state); Country country = countryService.findCountryByAbbreviation("US"); customerAddress.getAddress().setCountry(country); customerAddress.getAddress().setIsoCountrySubdivision("US-KY"); ISOCountry isoCountry = isoService.findISOCountryByAlpha2Code("US"); customerAddress.getAddress().setIsoCountryAlpha2(isoCountry); return customerAddressService.saveCustomerAddress(customerAddress); }
@Test(groups = "findStates", dependsOnGroups = "createState") public void findStates() { List<State> states = stateService.findStates(); assert states.size() > 0; }
state = stateService.findStateByAbbreviation(dto.getAddressStateRegion());
newModelVars.put("states", stateService.findStates()); newModelVars.put("countries", countryService.findCountries()); newModelVars.put("expirationMonths", populateExpirationMonths());
address.setPostalCode("75240"); address.setPrimaryPhone("972-978-9067"); address.setState(stateService.findStateByAbbreviation("KY")); address.setCountry(countryService.findCountryByAbbreviation("US")); address.setIsoCountrySubdivision("US-KY");