Unit test http connector and stub the response -- DO NOT WANT TO CALL REAL END POINT

I am looking for any pointers or links where I can perform unit testing, I would like to unit test a bpmn file.
This what I want to achieve
My bpmn file contains few service tasks which makes an http call
I would like to mock that http call and stub that response and move onto next task.
I dont want to call the real end point, instead, I would like to mock that http call and stub my response

I attached bpmn file, dmn file and my test class
sorry I cannot put error log, as I am a new user, I am allowed to attach only 2 links

create-template.bpmn (38.1 KB) CreateTemplateUnitTest1.txt (3.1 KB)

my pom.xml

‘’‘<camunda.spring.boot.starter.version>3.0.0</camunda.spring.boot.starter.version>
<camunda.version>7.9.0</camunda.version>’‘’

error
‘’'{R}22:27:42.822 [main] ERROR org.camunda.bpm.engine.context - ENGINE-16006 BPMN Stack Trace:
get-template-data (activity-leave, ProcessInstance[101])
get-template-data, name=get-template-data
^
|
validate-template, name=Validate Template
^
|
set-defaults, name=Set Defaults
^
|
StartEvent_1

22:27:42.831 [main] DEBUG org.camunda.bpm.engine.cmd - ENGINE-13011 closing existing command context
22:27:42.836 [main] ERROR org.camunda.bpm.engine.context - ENGINE-16004 Exception while closing command context: Unable to evaluate script while executing activity ‘get-template-data’ in the process definition with id ‘create-template:1:4’:TypeError: Cannot read property “length” from undefined in at line number 2’‘’

Hi,

Please follow below git URL, seems to be he has mocked the rest server.

I tried with above example, made changes accordingly in my repo
made changes in my code, added required dependencies, loading beans on start up and inject those beans on start up time
its failing at this line mockRestServer.verify();
I looked for this exception online, but those answers did not work
**CreateTemplateUnitTest.txt (7.3 KB) **
java.lang.AssertionError: Further request(s) expected leaving 1 unsatisfied expectation(s).
0 request(s) executed.

Here is a example of using wire mock so you don’t need to stub to much internally