@Override @Test (dependsOnMethods = { "read", "getEviction" }) public void update () { long id = 1; int expected = 50; Product p2 = new Product (); p2.setId (6L); p2.setUuid ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6"); Eviction eviction = dao.read (id); eviction.setMaxProductNumber (expected); assertTrue (eviction.getProducts ().isEmpty ()); eviction.getProducts ().add (p2); dao.update (eviction); eviction = dao.read (id); products = eviction.getProducts (); assertEquals (eviction.getMaxProductNumber (), expected); assertTrue (products.contains (p2)); dao.update (EvictionStrategy.LRU, 5, 8); eviction = dao.getEviction (); assertEquals (eviction.getStrategy (), EvictionStrategy.LRU); assertEquals (eviction.getKeepPeriod (), 5); assertEquals (eviction.getMaxDiskUsage (), 8); }
public void update (EvictionStrategy strategy, int keep_period, int max_disk_usage) { Eviction eviction = getEviction (); eviction.setKeepPeriod (keep_period); eviction.setMaxDiskUsage (max_disk_usage); eviction.setStrategy (strategy); update (eviction); }
EvictionDao extends HibernateDao<Eviction, Long> implements
      IEvictionDao { public void update (EvictionStrategy strategy, int keep_period, int max_disk_usage) { Eviction eviction = getEviction (); eviction.setKeepPeriod (keep_period); eviction.setMaxDiskUsage (max_disk_usage); eviction.setStrategy (strategy); update (eviction); } }
EvictionDao extends HibernateDao<Eviction, Long> implements
      IEvictionDao { public void update (EvictionStrategy strategy, int keep_period, int max_disk_usage) { Eviction eviction = getEviction (); eviction.setKeepPeriod (keep_period); eviction.setMaxDiskUsage (max_disk_usage); eviction.setStrategy (strategy); update (eviction); }  }
EvictionDao extends HibernateDao<Eviction, Long> implements
      IEvictionDao { public void update (EvictionStrategy strategy, int keep_period, int max_disk_usage) { Eviction eviction = getEviction (); eviction.setKeepPeriod (keep_period); eviction.setMaxDiskUsage (max_disk_usage); eviction.setStrategy (strategy); update (eviction); }  Eviction getFactoryDefault(); Eviction getEviction(); void update(EvictionStrategy strategy, int keep_period,
      int max_disk_usage); void setProducts(Set<Product> products); Set<Product> getProducts(); void removeProduct(Product product); }
EvictionDao extends HibernateDao<Eviction, Long> implements
      IEvictionDao { public void update (EvictionStrategy strategy, int keep_period, int max_disk_usage) { Eviction eviction = getEviction (); eviction.setKeepPeriod (keep_period); eviction.setMaxDiskUsage (max_disk_usage); eviction.setStrategy (strategy); update (eviction); }  Eviction getFactoryDefault(); Eviction getEviction(); void update(EvictionStrategy strategy, int keep_period,
      int max_disk_usage); void setProducts(Set<Product> products); Set<Product> getProducts(); void removeProduct(Product product);  }