### Question:
AutoDeleteQuery extends AutoModifyQuery<ENTITY> implements DeleteQuery { @Override public void prepare() { super.prepare(); assertNotNull(method, entityType); executable = true; preDelete(); prepareSpecialPropertyTypes(); validateIdExistent(); prepareOptions(); prepareOptimisticLock(); prepareSql(); assertNotNull(sql); } AutoDeleteQuery(EntityType<ENTITY> entityType); @Override void prepare(); @Override void complete(); void setVersionIgnored(boolean versionIgnored); void setOptimisticLockExceptionSuppressed(boolean optimisticLockExceptionSuppressed);  }### Answer:
@Test public void testPrepare() { Emp emp = new Emp(); AutoDeleteQuery<Emp> query = new AutoDeleteQuery<>(_Emp.getSingletonInternal()); query.setMethod(method); query.setConfig(runtimeConfig); query.setEntity(emp); query.setCallerClassName("aaa"); query.setCallerMethodName("bbb"); query.setSqlLogType(SqlLogType.FORMATTED); query.prepare(); assertNotNull(((DeleteQuery) query).getSql()); }
@Test public void testOption_default() { Emp emp = new Emp(); emp.setId(10); emp.setName("aaa"); emp.setVersion(100); AutoDeleteQuery<Emp> query = new AutoDeleteQuery<>(_Emp.getSingletonInternal()); query.setMethod(method); query.setConfig(runtimeConfig); query.setEntity(emp); query.setCallerClassName("aaa"); query.setCallerMethodName("bbb"); query.setSqlLogType(SqlLogType.FORMATTED); query.prepare(); PreparedSql sql = query.getSql(); assertEquals("delete from EMP where ID = ? and VERSION = ?", sql.getRawSql()); List<InParameter<?>> parameters = sql.getParameters(); assertEquals(2, parameters.size()); assertEquals(10, parameters.get(0).getWrapper().get()); assertEquals(100, parameters.get(1).getWrapper().get()); }
@Test public void testTenantId() { Salesman salesman = new Salesman(); salesman.setId(10); salesman.setName("aaa"); salesman.setTenantId("bbb"); salesman.setVersion(100); AutoDeleteQuery<Salesman> query = new AutoDeleteQuery<>(_Salesman.getSingletonInternal()); query.setMethod(method); query.setConfig(runtimeConfig); query.setEntity(salesman); query.setCallerClassName("aaa"); query.setCallerMethodName("bbb"); query.setSqlLogType(SqlLogType.FORMATTED); query.prepare(); PreparedSql sql = query.getSql(); assertEquals( "delete from SALESMAN where ID = ? and VERSION = ? and TENANT_ID = ?", sql.getRawSql()); List<InParameter<?>> parameters = sql.getParameters(); assertEquals(3, parameters.size()); assertEquals(10, parameters.get(0).getWrapper().get()); assertEquals(100, parameters.get(1).getWrapper().get()); assertEquals("bbb", parameters.get(2).getWrapper().get()); }