Re-enable TestDbJson_Jackson3 via adding mutationDetection = HASH to beanList property

@DbJsonB(mutationDetection = HASH)
  List<PlainBean> beanList;
This commit is contained in:
rbygrave
2021-07-29 23:17:11 +12:00
parent 20becf951d
commit 20e0eb1021
2 changed files with 4 additions and 6 deletions
@@ -161,10 +161,7 @@ public class TestDbJson_Jackson3 extends BaseTestCase {
final EBasicJsonList found = DB.find(EBasicJsonList.class, bean.getId());
found.getBeanList().get(0).setName("p1-mod");
// BeanState state = DB.getBeanState(found);
// assertThat(state.getChangedProps()).containsExactlyInAnyOrder("beanList");
// this test fails, because we have a OmList instead of a GenericObject
// TODO: Can/Should we enhance the @DbJson/@DbJsonB annotations with a property "dirtyDetection"
BeanState state = DB.getBeanState(found);
assertThat(state.getChangedProps()).containsExactlyInAnyOrder("beanList");
}
}
@@ -9,6 +9,7 @@ import javax.persistence.Id;
import javax.persistence.Version;
import java.util.*;
import static io.ebean.annotation.MutationDetection.HASH;
import static io.ebean.annotation.MutationDetection.SOURCE;
@Entity
@@ -22,7 +23,7 @@ public class EBasicJsonList {
@DbJson(length = 700, name = "beans")
Set<PlainBean> beanSet;
@DbJsonB
@DbJsonB(mutationDetection = HASH)
List<PlainBean> beanList;
@DbJson(length = 700)