mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2328 - Postgres JSONB dirty checking - trim json
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package io.ebeaninternal.server.type;
|
||||
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class JsonTrimTest {
|
||||
|
||||
@Test
|
||||
public void trim_array() {
|
||||
final String trimmed = JsonTrim.trim("[{\"name\": \"one\", \"along\": 1, \"timestamp\": 1629609021559}, {\"name\": \"two\", \"along\": 2, \"timestamp\": 1629609021559}]");
|
||||
assertThat(trimmed).isEqualTo("[{\"name\":\"one\",\"along\":1,\"timestamp\":1629609021559},{\"name\":\"two\",\"along\":2,\"timestamp\":1629609021559}]");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void trim_object() {
|
||||
final String trimmed = JsonTrim.trim("{\"name\": \"one\",\t \t \"along\": 1, \"timestamp\": 1629609021559}");
|
||||
assertThat(trimmed).isEqualTo("{\"name\":\"one\",\"along\":1,\"timestamp\":1629609021559}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user