@Test public void shouldNotBeNewIfThereIsID() throws JSONException { Child child = new Child(); child.put(internal_id.getColumnName(), "xyz"); assertThat(child.isNew(), is(false)); }
@Test public void shouldBeNewIfThereIsNoID() throws JSONException { Child child = new Child("id1", "user1", "{ 'test1' : 'value1' }"); assertThat(child.isNew(), is(true)); }