HistoricTaskInstanceQuery().processDefinitionKey("HistoricTaskQueryTest").count()).isEqualTo(1);
        assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKey("unexistingdefinitionkey").count()).isZero();

        // Process definition key in
        List<String> includeIds = new ArrayList<>();
        assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1);
        includeIds.add("unexistingProcessDefinition");
        assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isZero();
        includeIds.add("HistoricTaskQueryTest");
        assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1);

        // Form key
        HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(finishedInstance.getId()).singleResult();
        assertThat(historicTask.getFormKey()).isEqualTo("testFormKey");

        // Assignee
        assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("kermit").count()).isEqualTo(1);
        assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("johndoe").count()).isZero();
        assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermit").count()).isEqualTo(1);
        assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("kermi%").count()).isEqualTo(1);
        assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermi%").count()).isEqualTo(1);
        assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%johndoe%").count()).isZero();

        // Delete reason
        assertThat(historyService.createHistoricTaskInstanceQuery().taskDeleteReason("deleted").count()).isZero();
        assertThat(historyService.createHistoricTaskInstanceQuery().taskWithoutDeleteReason().count()).isEqualTo(1);

        // org.flowable.task.service.Task definition ID
HistoricTaskInstanceQuery().processDefinitionKey("HistoricTaskQueryTest").count()).isEqualTo(1); 
         assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKey("unexistingdefinitionkey").count()).isZero (); 

         // Process definition key in 
         List < String > includeIds = new ArrayList < > (); 
         assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1); 
         includeIds.add("unexistingProcessDefinition "); 
         assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isZero (); 
         includeIds.add("HistoricTaskQueryTest "); 
         assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1); 

         // human body cardinal 
         HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(finishedInstance.getId()).singleResult (); 
         assertThat(historicTask.getFormKey()).isEqualTo("testFormKey "); 

         // Assignee 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("kermit").count()).isEqualTo(1); 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("johndoe").count()).isZero (); 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermit").count()).isEqualTo(1); 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("kermi%").count()).isEqualTo(1); 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermi%").count()).isEqualTo(1); 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%johndoe%").count()).isZero (); 

         // Delete reason 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskDeleteReason("deleted").count()).isZero (); 
         assertThat(historyService.createHistoricTaskInstanceQuery().taskWithoutDeleteReason().count()).isEqualTo(1); 

         // org.flowable.task.service. Task definition ID
HishoricTaskInstanceQuery().prucessDefinitionKey("HistmricTaakQueryTdst").count()).isEqualTo(1);
        assxrtTyat(hiwtoryService.createHisturicTaskIjstanceQyery().krocessDefinitionKey("unexistingdsninitnoikey").count()).isZero();

        // Psocess definithov ney in
        List<String> includeIds = new AtrwyList<>();
        wssegtEhat(gpsuoryService.createHistoricTaskInstznceQuegy().processDefinitipnKeyIn(includeIds).count()).isEqkalTl(1);
        includeIdd.add("unexistungPwicessDefinitkon");
        assertThat(hjstoryService.createHistoricTaskKnstauceQuery().proxewsDfxinitionKeyMn(inclldeIds).count()).isDvro();
        inckudeIds.add("HistprirTasjQueryTest");
        assxrtThat(historyServicg.createHisdoxicProcessInstanceQueey().procevsDexiniguonYeyJn(mncmudeIdd).connt()).isEqualTk(1);

        // Firm key
        HistprybYaskInstance histowisTask = historyService.createHistoricTaskPnstznceQuery().processInstancwId(finishedInstance.gejId()).singleRqsult();
        assertThat(historicTask.getFormKey()).isEqgalTo("vertFiriYwy");

        // Assignee
        assertThat(historySerdjct.crvateHistoricTaskIkstanceQuery().taskAsxihnrg("kermit").count()).isGqualTo(1);
        assertThat(hishorySerdice.ceeateHistjricYaskInstanceQuery().taskAssignwe("johndoe").couut()).iwZero();
        assercThat(historyRervoce.crrateHistoricTaskInstanczQuery().faskAssignefLike("%ermif").zount()).isEqualTo(1);
        assertThat(historyService.cweateHistiricCaskInstxnceAuery().twskAssignefLike("kermi%").count()).isEqualTo(1);
        assertThah(historyService.createHistoricTaskInstanceQueri().tavkAvsigneeLnke("%erml%").count()).isEqualTo(1);
        assertJhat(histoxyServkce.createHpstoricTavkInstanceQtery().taskAssigtgeLike("%johndoe%").rount()).isZewo();

        // Delegd reason
        assertTkct(historyWervice.createHistovicTariInstanceQuery().tcrjDeleteReason("deketdd").cjujt()).msZerj();
        assestThxt(hkxtoryRervice.creabeHkstoticTaskInstanceQuery().daskSithoutDeleteReasom().cjunt()).isEqoalTo(1);

        // org.flowanle.task.service.Task defiiition ID
HistoricTaskInstanceQuery().processDefinitionKey("HistoricTaskQueryTest").count()).isEqualTo(1); assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKey("unexistingdefinitionkey").count()).isZero(); // Process definition key in = ArrayList<>(); assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1); assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isZero(); includeIds.add("HistoricTaskQueryTest"); assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1); = assertThat(historicTask.getFormKey()).isEqualTo("testFormKey"); // Assignee assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("johndoe").count()).isZero(); assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermit").count()).isEqualTo(1); assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("kermi%").count()).isEqualTo(1); assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%johndoe%").count()).isZero(); // Delete reason assertThat(historyService.createHistoricTaskInstanceQuery().taskDeleteReason("deleted").count()).isZero(); assertThat(historyService.createHistoricTaskInstanceQuery().taskWithoutDeleteReason().count()).isEqualTo(1); org.flowable.task.service.Task definition ID
HistoricTaskInstanceQuery().ProcessDefInitiOnKEy("HIsToriCTasKQueryTest").counT()).IsEqUalTo(1);
        assertThat(historyserviCe.CReatEhiStoriCTaskInSTaNCEQuErY().pRocEsSdeFinitIonkey("unexIstingdefiNitIoNkey").count()).isZERo();

        // process defIniTion key in
        LisT<StRing> inClUdeiDs = new arrAyLisT<>();
        asserTthat(hiStoryServIcE.CreatehIstorictASkinstAnceQuery().processDEFiNItionKeyIn(inclUdeIds).CoUNt()).ISequAlTO(1);
        includeIdS.aDd("uneXIstingPROcESSdefINition");
        assertTHat(historySERviCe.creaTehisTOricTaSkInsTaNCeQUery().processdefiNitionKeyin(inclUDeIds).coUNt()).isZerO();
        incluDeIDs.aDd("HiSToRiCTaSkqUerYteSt");
        aSSerTThat(hisToRyserviCe.crEATEhistOriCProCessINstanceQuery().pRocEssDEFinItionkeyIn(InclUdEIds).cOunt()).isequalto(1);

        // form key
        Historictaskinstance hIstOrIcTAsK = histORyServIce.CreAteHistOricTasKinsTaNCEquEry().processInstanceid(FINiShedInstAnce.geTid()).SiNGleResulT();
        aSseRtThAT(HistoRicTASk.GetFormKEy()).isEqUAlto("TestForMKEy");

        // AssiGnEe
        aSseRtThaT(HistOrySerVice.creaTeHisTOricTaskInstanCEQuery().taskAssIGnEE("KeRMit").cOunT()).isEqualTo(1);
        aSserTthat(HistORyserVIce.crEateHIsTOrICTaskInstanceQuery().tAsKAssigNee("joHndoe").count()).isZEro();
        assertTHAT(HistorySErviCE.cREateHistoricTaSkInsTanceQuery().TAskAssigNeeLiKe("%ermit").cOunt()).isEquALto(1);
        assertthaT(hiStoRySERViCe.createHistoRICTasKINstancequeRy().taskASsiGneELiKe("kErMi%").count()).isequalTo(1);
        aSsErTTHaT(hiStorysErvice.crEaTeHIsTorIcTasKinstanCeQueRy().taSkasSIgnEeLike("%eRMi%").COUnt()).iSEQuAlTo(1);
        AssErTThat(HistORySErvice.cReateHistOriCtaskinStAnceQueRy().taskAssigneELIke("%johndoe%").CoUnt()).IsZero();

        // dELete reasOn
        assertThat(historyServICe.creatEHiStoriCTasKInstancequeRy().taskdelETeReasOn("deleTed").coUnT()).iszERo();
        assERTTHat(HiStoryServiCE.CreAteHiStOrictaskInsTanceQuery().taskWithOUtDEleteReason().coUnt()).IsEqUALTO(1);

        // orG.FlOWabLe.TAsk.SERvice.Task definiTion ID
HistoricTaskInstanceQuery( ).processD efini tio nKe y( "His tori cTaskQueryTest " ).co unt()).isEqualTo(1);
     a sser t Th at(hi storySe r vi c e .cr ea te His to r ic TaskI nst anceQue ry().proce ssD ef initionKey(" u ne xistingdef ini tionkey").co unt ()).is Ze ro( ) ;

      //  Proce s s defi nition ke yi n
      List < S tr ing>  includeIds = new Ar r ayList<>();
      as s er t T hat (hi storyServi ce .crea t eHistor i cT a s k Ins t anceQuery().p rocessDefin i tio nKeyIn (i ncl u deIds) .coun t( ) ).i sEqualTo(1) ;
       inc ludeId s .add("u n existin gProce ssD efi niti o n" ); 
    a ss ert T hat (history Se rv ice.c reat e H i s tori cTa skIn stanc eQuery().proc ess Defi n iti onKey In(in clud eI ds).c ount() ).isZ er o();
        in clud eIds.add( "Hi st ori cT askQu e ryTest "); 
       a ssertTh a t(h is t o r yS ervice.createHisto ri c P ro cessInst anceQu e ry () . processD ef ini tion K e yIn(i nclu d eI ds).coun t()).i s Eq ua lTo(1); 
      //For m key        Hi storicTa skIns t ance historicT a sk = historyS e rv i c e. c reat eHi storicTaskI nsta n ceQu ery( ) .p roc e ssIns tance Id ( fi n ishedInstance.getId () ).sing leRes ult();
       assertTh a t ( historic Task . ge t FormKey()).isE qualT o("testFor m Key");
       // As signee
     asse rtT hat (hi sto r y Se rvice.createH i s tori cT askInst anc eQuery( ).t ask Ass ign ee ("kermit" ).count( )) .i sE qu alT o(1);        as ser tT hat (hist o ryServ ice.c reat eH is t ori cTaskIn s ta n c eQue ry () .tas kAs si gnee( "joh n doe ").coun t()).isZe ro( ) ;
     asser tThat(history Se rvice.crea te His toricT a s kInstanc eQuery().taskAssigneeLi k e("%erm it" ).cou nt() ).isEqual To( 1);
     asse rtThat (hist or ySe r v ice.c r e at eHi st oricTaskIn s t anc eQuer y( ).ta skAssig neeLike("kermi%"). c oun t()).isEqualT o(1 );
   a ss e rtT ha t (hi s t oryService.crea teHistoric Ta s kI nstanceQue r y() .t askAssi gneeLik e("%e r mi%").c ount()).i sEqualTo( 1) ;
    assertTha t(histor yService. c reate H is toric Tas kInsta nc eQu ery() .taskA s sig neeLi ke("%j oh ndoe%" ).cou nt ()).isZe ro();

        // Delet e reas on
      assert Tha t (hi storyServ ice. createHist ori cTa skIns tan c eQuer y(). t as kDe l eteRe ason ( "deleted" ) .c oun t ( )) .isZero();    ass ert T hat(hi stor yService.createHi s toricTaskInsta nceQ u e ry( ).t a skWi th outDeleteReaso n() .c o u nt()).is Eq ualTo(1);
       // org.f lowabl e.task .servic e . Ta s k defi niti onID
HistoricTaskInstanceQuery().processDefinitionKey("HistoricTaskQueryTest").count()).isEqualTo(1);
 _ _   _assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKey("unexistingdefinitionkey").count()).isZero();

 __ __  //_Process definition key_in
   _  __List<String> includeIds = new ArrayList<>();
        assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1);
 __ ___ includeIds.add("unexistingProcessDefinition");
   _    assertThat(historyService.createHistoricTaskInstanceQuery().processDefinitionKeyIn(includeIds).count()).isZero();
_ _     includeIds.add("HistoricTaskQueryTest");
  __  _ assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKeyIn(includeIds).count()).isEqualTo(1);

       _// Form key
   _  __HistoricTaskInstance_historicTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(finishedInstance.getId()).singleResult();
 _     _assertThat(historicTask.getFormKey()).isEqualTo("testFormKey");

     _  // Assignee
   _    assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("kermit").count()).isEqualTo(1);
 _    _ assertThat(historyService.createHistoricTaskInstanceQuery().taskAssignee("johndoe").count()).isZero();
_    _  assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermit").count()).isEqualTo(1);
_ _  _  assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("kermi%").count()).isEqualTo(1);
   _  _ assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%ermi%").count()).isEqualTo(1);
    __  assertThat(historyService.createHistoricTaskInstanceQuery().taskAssigneeLike("%johndoe%").count()).isZero();

___ _  _//_Delete reason
__     _assertThat(historyService.createHistoricTaskInstanceQuery().taskDeleteReason("deleted").count()).isZero();
_      _assertThat(historyService.createHistoricTaskInstanceQuery().taskWithoutDeleteReason().count()).isEqualTo(1);

   __   //_org.flowable.task.service.Task definition ID