Skip to content

Commit

Permalink
AAE-23566 fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
revatilimaye committed Aug 21, 2024
1 parent 6b9b586 commit 7f4a0ac
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
import org.activiti.cloud.api.task.model.events.CloudTaskCancelledEvent;
import org.activiti.cloud.api.task.model.events.CloudTaskCandidateUserRemovedEvent;
import org.activiti.cloud.api.task.model.events.CloudTaskCreatedEvent;
import org.activiti.cloud.identity.IdentityService;
import org.activiti.cloud.services.events.ActorConstants;
import org.activiti.cloud.services.test.containers.KeycloakContainerApplicationInitializer;
import org.activiti.cloud.starter.tests.helper.ProcessInstanceRestTemplate;
Expand Down Expand Up @@ -189,6 +190,9 @@ public class AuditProducerIT {
@Autowired
private AuditConsumerStreamHandler streamHandler;

@Autowired
private IdentityService identityService;

private Map<String, String> processDefinitionIds = new HashMap<>();
private Map<String, Integer> processDefinitionVersions = new HashMap<>();
private Map<String, String> processDefinitionAppVersions = new HashMap<>();
Expand Down Expand Up @@ -464,11 +468,11 @@ void shouldProduceEventsDuringSimpleProcessExecutionWithActor() {
.withBusinessKey("my business key")
.build()
);

//then
List<IdentityLink> identityLinksForProcessInstance = runtimeService.getIdentityLinksForProcessInstance(
startProcessEntity.getBody().getId()
);
String id = identityService.findUserByName("hruser").getId();
String expectedActor = new String(
identityLinksForProcessInstance
.stream()
Expand All @@ -482,7 +486,7 @@ void shouldProduceEventsDuringSimpleProcessExecutionWithActor() {
.filteredOn(it -> ActorConstants.ACTOR_TYPE.equals(it.getType()))
.isNotEmpty()
.extracting(IdentityLink::getUserId, IdentityLink::getDetails)
.containsOnly(tuple("c67e205b-0818-4dc1-ba36-4c6d4a602117", expectedActor.getBytes()));
.containsOnly(tuple(id, expectedActor.getBytes()));

//and given
ResponseEntity<PagedModel<CloudTask>> tasks = processInstanceRestTemplate.getTasks(startProcessEntity);
Expand Down

0 comments on commit 7f4a0ac

Please sign in to comment.