@Test public void testCreateManufacturerService() throws ServiceException { Language DEFAULT_LANGUAGE = languageService.getByCode("en"); Language FRENCH = languageService.getByCode("fr"); Currency currency = currencyService.getByCode("CAD"); Country ca = super.countryService.getByCode("CA"); // create a merchant MerchantStore store = new MerchantStore(); store.setCountry(ca); store.setCurrency(currency); store.setDefaultLanguage(DEFAULT_LANGUAGE); store.setInBusinessSince(date); store.setStorename("store name"); store.setStoreEmailAddress("*****@*****.**"); merchantService.create(store); Manufacturer manufacturer = new Manufacturer(); manufacturer.setMerchantSore(store); ManufacturerDescription fd = new ManufacturerDescription(); fd.setLanguage(FRENCH); fd.setName("Sony french"); fd.setManufacturer(manufacturer); ManufacturerDescription ed = new ManufacturerDescription(); ed.setLanguage(DEFAULT_LANGUAGE); ed.setName("Sony english"); ed.setManufacturer(manufacturer); Set descriptions = new HashSet(); descriptions.add(fd); descriptions.add(ed); manufacturer.setDescriptions(descriptions); manufacturerService.create(manufacturer); manufacturerService.delete(manufacturer); // merchantService.delete(store); }