From 0b8a6317f778bafb4a460a99dfd96f3a127167d2 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Mon, 26 Aug 2024 13:40:42 +0200 Subject: [PATCH] Refetch case instances to make sure the time that we compare against is the same as in the DB SQL Server sometimes rounds up the time, with this approach we avoid having flaky tests on SQL Server --- .../rest/service/api/runtime/CaseInstanceQueryResourceTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceQueryResourceTest.java b/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceQueryResourceTest.java index f043cadd194..f7ecd848640 100644 --- a/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceQueryResourceTest.java +++ b/modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceQueryResourceTest.java @@ -207,6 +207,8 @@ public void testQueryCaseInstancesPagingAndSorting() throws Exception { Authentication.setAuthenticatedUserId("queryCaseUser"); CaseInstance caseInstance1 = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start(); CaseInstance caseInstance2 = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("testRepeatingStage").start(); + caseInstance1 = runtimeService.createCaseInstanceQuery().caseInstanceId(caseInstance1.getId()).singleResult(); + caseInstance2 = runtimeService.createCaseInstanceQuery().caseInstanceId(caseInstance2.getId()).singleResult(); // Create request node ObjectNode requestNode = objectMapper.createObjectNode();