Пример #1
0
  /** Test whether the product updation date is updated when merging. */
  @Test
  public void testSubsequentUpdate() {
    Product prod = new Product("test-label", "test-product-name", owner);
    productCurator.create(prod);

    Calendar calendar = Calendar.getInstance();
    calendar.add(Calendar.MONTH, -2);
    prod.setUpdated(calendar.getTime());

    long updated = prod.getUpdated().getTime();

    prod.setName("test-changed-name");
    prod = this.productCurator.merge(prod);
    assertTrue(prod.getUpdated().getTime() > updated);
  }
Пример #2
0
  @Test
  public void testInitialUpdate() {
    Product prod = new Product("test-label", "test-product-name", owner);
    productCurator.create(prod);

    assertNotNull(prod.getUpdated());
  }