mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #2282 from ebean-orm/feature/json-mutable-collections
Treat json Jackson collections the same wrt mutation detection
This commit is contained in:
@@ -104,9 +104,6 @@ public class ServerConfigTest {
|
||||
assertEquals(PlatformConfig.DbUuid.BINARY, serverConfig.getPlatformConfig().getDbUuid());
|
||||
assertEquals(JsonConfig.DateTime.MILLIS, serverConfig.getJsonDateTime());
|
||||
assertEquals(JsonConfig.Date.MILLIS, serverConfig.getJsonDate());
|
||||
assertFalse(serverConfig.isJsonDirtyByDefault());
|
||||
serverConfig.setJsonDirtyByDefault(true);
|
||||
assertTrue(serverConfig.isJsonDirtyByDefault());
|
||||
|
||||
assertEquals("r0,users,orgs", serverConfig.getEnabledL2Regions());
|
||||
|
||||
@@ -159,7 +156,6 @@ public class ServerConfigTest {
|
||||
assertFalse(serverConfig.isIdGeneratorAutomatic());
|
||||
assertEquals(JsonConfig.DateTime.ISO8601, serverConfig.getJsonDateTime());
|
||||
assertEquals(JsonConfig.Date.ISO8601, serverConfig.getJsonDate());
|
||||
assertTrue(serverConfig.isJsonDirtyByDefault());
|
||||
assertTrue(serverConfig.getPlatformConfig().isCaseSensitiveCollation());
|
||||
assertTrue(serverConfig.isAutoLoadModuleInfo());
|
||||
|
||||
|
||||
@@ -76,10 +76,11 @@ public class TestDbJson_List extends BaseTestCase {
|
||||
update_when_dirty();
|
||||
update_when_dirty_flags();
|
||||
update_when_dirty_SetListMap();
|
||||
|
||||
DB.delete(found);
|
||||
}
|
||||
|
||||
//@Test//(dependsOnMethods = "insert")
|
||||
public void json_parse_format() {
|
||||
private void json_parse_format() {
|
||||
|
||||
String asJson = DB.json().toJson(found);
|
||||
assertThat(asJson).contains("\"tags\":[\"one\",\"two\"]");
|
||||
@@ -104,8 +105,7 @@ public class TestDbJson_List extends BaseTestCase {
|
||||
assertThat(fromJson.getBeanMap()).hasSize(2);
|
||||
}
|
||||
|
||||
//@Test//(dependsOnMethods = "insert")
|
||||
public void update_when_notDirty() {
|
||||
private void update_when_notDirty() {
|
||||
|
||||
found.setName("mod");
|
||||
LoggedSqlCollector.start();
|
||||
@@ -117,7 +117,7 @@ public class TestDbJson_List extends BaseTestCase {
|
||||
assertSql(sql.get(0)).contains("update ebasic_json_list set name=?, version=? where");
|
||||
}
|
||||
|
||||
public void update_when_dirty() {
|
||||
private void update_when_dirty() {
|
||||
|
||||
//found.setName("modAgain");
|
||||
found.getTags().add("three");
|
||||
@@ -131,7 +131,7 @@ public class TestDbJson_List extends BaseTestCase {
|
||||
assertSql(sql.get(0)).contains("update ebasic_json_list set tags=?, version=? where id=? and version=?");
|
||||
}
|
||||
|
||||
public void update_when_dirty_flags() {
|
||||
private void update_when_dirty_flags() {
|
||||
|
||||
//found.setName("modAgain");
|
||||
found.getFlags().remove(42L);
|
||||
@@ -145,7 +145,7 @@ public class TestDbJson_List extends BaseTestCase {
|
||||
assertSql(sql.get(0)).contains("update ebasic_json_list set flags=?, version=? where id=? and version=?;");
|
||||
}
|
||||
|
||||
public void update_when_dirty_SetListMap() {
|
||||
private void update_when_dirty_SetListMap() {
|
||||
|
||||
//found.setName("modAgain");
|
||||
found.getBeanSet().clear();
|
||||
|
||||
@@ -20,6 +20,7 @@ public class EBasicJsonList {
|
||||
|
||||
String name;
|
||||
|
||||
// @JsonDeserialize(as=LinkedHashSet.class)
|
||||
@DbJson(length = 700, name = "beans")
|
||||
Set<PlainBean> beanSet;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user