ProcessInstanceAssert based on random values

Hi, Our requirement is fetching a random value(Success,Failure) based on a fixed set of inputs. Let say input(x-yes,y-yes) and the microservice sends request to another microservice(Which randomly generates success or failure) and we are using ProcessInstanceAssert to assert the condition at the end in Junit.

In this scenario, the same assertInstance() method fails/success for the same set of inputs(Agree the microservice should return proper value instead of random 1 or 0 success/failure but we are struck for now). Is there a way i can check the condition before asserting them.

Exclusive gateway which decides the path based on the returned value from microservice.
image

can someone help in understanding how to assert when the decision is taken by exclusive gateway ? Thanks in advance. Has got the code snippet from the below URL but even the eclipse is not able to find suggestions to import dependencies . can the complete package name be specifed please ?

https://camunda.com/best-practices/testing-process-definitions/#__strong_scope_1_strong_unit_testing_the_wider_process_definition

  complete(task(), withVariables(TwitterDemoProcessConstants.VAR_NAME_APPROVED, true));