VoAddressBookServiceImpl implements VoAddressBookService { @Override public VoAddressBook getAddressBook(final long customerId, final long formattingShopId, final String lang) throws Exception { if (federationFacade.isManageable(customerId, CustomerDTO.class)) { final VoAddressBook addressBook = new VoAddressBook(); addressBook.setFormattingShopId(formattingShopId); setShopLocations(addressBook, formattingShopId, lang); setAddressBookAddresses(addressBook, customerId); setFormattedAddresses(addressBook, customerId, formattingShopId, lang); setAddressFormFieldsConfiguration(addressBook, customerId, formattingShopId); return addressBook; } else { throw new AccessDeniedException("Access is denied"); } } VoAddressBookServiceImpl(final DtoAddressService dtoAddressService,
                                    final DtoShopService dtoShopService,
                                    final CountryService countryService,
                                    final StateService stateService,
                                    final FederationFacade federationFacade,
                                    final VoAssemblySupport voAssemblySupport); @Override VoAddressBook getAddressBook(final long customerId, final long formattingShopId, final String lang); @Override VoAddress updateAddress(final VoAddress vo); @Override VoAddress createAddress(final VoAddress vo); @Override void removeAddress(final long id);  }
@Test public void testGetAddressBook() throws Exception { VoAddressBook addressBook = voAddressBookService.getAddressBook(10001L, 10L, "en"); assertNotNull(addressBook); assertNotNull(addressBook.getAddresses()); assertFalse(addressBook.getAddresses().isEmpty()); assertNotNull(addressBook.getBillingCountries()); assertFalse(addressBook.getBillingCountries().isEmpty()); assertNotNull(addressBook.getShippingCountries()); assertFalse(addressBook.getShippingCountries().isEmpty()); assertNotNull(addressBook.getBillingCountries().get(0).getSubLocations()); assertFalse(addressBook.getBillingCountries().get(0).getSubLocations().isEmpty()); }