Spring Boot with REST Connector with JUnit 5 and Wiremock

Hi,

is there an example of a Spring Boot application ( version >= 3.1 ) using Camunda ( version >= 8.3 ) with REST Connector with unit test ( JUnit 5 and Wiremock ) ?
The most important part for me is the unit test part.

I tried to create such an application but with no success: camunda/spring-boot/rest-connector at rest-connector · aowss/camunda (github.com)

Thanks,
Aowss

I double checked and the connector is making the request; the request is matched by wiremock; the response is sent back; the connector is able to create the variable with the right value

but I still get the following error:

2023-12-29T16:10:40.230-05:00 WARN 29352 — [ault-executor-0] .DefaultCommandExceptionHandlingStrategy : Retrying {command=class io.camunda.zeebe.client.impl.command.CompleteJobCommandImpl, job={“key”:2251799813685281,“type”:“io.camunda:http-json:1”,“customHeaders”:{“retryBackoff”:“PT0S”,“resultExpression”:“={ exchangeRate: response.body.rate }”},“processInstanceKey”:2251799813685262,“bpmnProcessId”:“Process_RESTConnector”,“processDefinitionVersion”:1,“processDefinitionKey”:2251799813685250,“elementId”:“Task_CallExchangeRateAPI”,“elementInstanceKey”:2251799813685274,“tenantId”:“”,“worker”:“HTTP REST”,“retries”:1,“deadline”:1703884539343,“variables”:"{"url":"http://localhost:9999/exchangeRates\“,\“method\”:\“GET\”,\“headers\”:{\“accept\”:\“application/json\”},\“authentication\”:{\“type\”:\“noAuth\”},\“queryParameters\”:{\“fromCurrency\”:\“USD\”,\“toCurrency\”:\“CAD\”,\“amount\”:1000},\“connectionTimeoutInSeconds\”:\“20\”,\“apiURL\”:\“http://localhost:9999/exchangeRates\”,\“fromAmount\”:1000,\“toCurrency\”:\“CAD\”,\“fromCurrency\”:\“USD\”}”,“variablesAsMap”:{“url”:“http://localhost:9999/exchangeRates”,“method”:“GET”,“headers”:{“accept”:“application/json”},“authentication”:{“type”:“noAuth”},“queryParameters”:{“fromCurrency”:“USD”,“toCurrency”:“CAD”,“amount”:1000},“connectionTimeoutInSeconds”:“20”,“apiURL”:“http://localhost:9999/exchangeRates”,“fromAmount”:1000,“toCurrency”:“CAD”,“fromCurrency”:“USD”}}, currentRetryDelay=71} after error of type ‘UNAVAILABLE’ with backoff

The problem seems to be with this line in SpringConnectorJobHandler:

new CommandWrapper(commandStep, job, commandExceptionHandlingStrategy).executeAsync();

It turned out to be the fact that i was not waiting for the process to end.
The impression i got was different because i was debugging.

I find the error not very clear.

The example has been updated in camunda/spring-boot/rest-connector at main · aowss/camunda · GitHub

Hi @aowss, maybe our e2e tests can give you some inspiration on how to combine the components you mentioned: connectors/connectors-e2e-test/connectors-e2e-test-http/src/test/java/io/camunda/connector/e2e/HttpTests.java at d78cfb4e223ec76f7c6ad907cdac91bf0cfd8550 · camunda/connectors · GitHub

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.