@Before public void setUp() { LocalizerServiceStub localizerServiceStub = new LocalizerServiceStub() { @Override public String getLocalizedTextFromDatabase( String localeString, long objectKey, LocalizedObjectTypes objectType) { return localizedText; } }; facade = new LocalizerFacade(localizerServiceStub, Locale.GERMAN.getLanguage()); // server side entries Product product = new Product(); product.setKey(PRODUCT_KEY); product.setTechnicalProduct(new TechnicalProduct()); product.setAutoAssignUserEnabled(false); ProductFeedback feedback = new ProductFeedback(); feedback.setAverageRating(new BigDecimal("2.5")); product.setProductFeedback(feedback); mp = new Marketplace(); mp.setKey(1); mp.setMarketplaceId(MP_ID); mp.setOrganization(new Organization()); catalogEntry = new CatalogEntry(); catalogEntry.setKey(1); catalogEntry.setProduct(product); catalogEntry.setMarketplace(mp); catalogEntry.setAnonymousVisible(true); catalogEntry.setVisibleInCatalog(true); catalogEntry2 = new CatalogEntry(); catalogEntry2.setKey(2); catalogEntry3 = new CatalogEntry(); catalogEntry3.setKey(3); VOMarketplace voMp = new VOMarketplace(); voMp.setMarketplaceId(MP_ID); // incoming entries voCatalogEntry = new VOCatalogEntry(); voCatalogEntry.setKey(1); voCatalogEntry.setVersion(0); voCatalogEntry.setMarketplace(voMp); voCatalogEntry.setAnonymousVisible(true); voCatalogEntry.setVisibleInCatalog(true); voCatalogEntry2 = new VOCatalogEntry(); voCatalogEntry2.setKey(2); voCatalogEntry3 = new VOCatalogEntry(); voCatalogEntry3.setKey(3); }
@Before public void setup() throws Exception { dsMock = mock(DataService.class); Organization org = new Organization(); org.setOrganizationId(ORGANIZATIONID); PlatformUser user = new PlatformUser(); user.setUserId(USERID_1); user.setLocale("en"); user.setOrganization(org); when(dsMock.getCurrentUser()).thenReturn(user); marketplace = new Marketplace(); marketplace.setKey(1000l); doReturn(marketplace).when(dsMock).getReferenceByBusinessKey(any(Marketplace.class)); }