No effective change - add test for explicit deleted = true property use

This commit is contained in:
Robin Bygrave
2016-05-04 10:50:30 +12:00
parent dbed34cc51
commit dc230af60b
@@ -43,6 +43,27 @@ public class TestSoftDeleteBasic extends BaseTestCase {
assertThat(findInclude).isNotNull();
}
@Test
public void testFindSoftDeleted() {
EBasicSoftDelete bean = new EBasicSoftDelete();
bean.setName("softDelFetch");
Ebean.save(bean);
Ebean.delete(bean);
Query<EBasicSoftDelete> query = Ebean.find(EBasicSoftDelete.class)
.setIncludeSoftDeletes()
.where()
.eq("deleted", true)
.eq("name", "softDelFetch")
.query();
List<EBasicSoftDelete> list = query.findList();
assertThat(query.getGeneratedSql()).contains("deleted = ?");
assertThat(list).hasSize(1);
}
@Test
public void testDeleteById_and_findRowCount() {