コード例 #1
0
 @Test
 public void updateCatalogEntry_updateVisibleInCatalog() throws Exception {
   Assert.assertEquals(voCatalogEntry.isVisibleInCatalog(), catalogEntry.isVisibleInCatalog());
   voCatalogEntry.setVisibleInCatalog(!catalogEntry.isVisibleInCatalog());
   assertFalse(voCatalogEntry.isVisibleInCatalog() == catalogEntry.isVisibleInCatalog());
   CatalogEntry entry = CatalogEntryAssembler.updateCatalogEntry(catalogEntry, voCatalogEntry);
   Assert.assertEquals(voCatalogEntry.isVisibleInCatalog(), entry.isVisibleInCatalog());
 }
コード例 #2
0
  @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);
  }