Integration Tests for atlassian-connect-spring-boot apps

Hi everyone,

We have a Jira cloud plugin that uses atlassian-connect-spring-boot.
The plugin implements a few custom Rest services that are called from the plugin’s JavaScript code.
The Rest services itself are calling Jira to collect different data and do some calculations based on it.
When calling the REST services from the JavaScript we are putting the JWT token into the request header, the token itself is obtained from the plugin page’s meta tag.
On the server we are using the atlassianHostRestClients to do the Jira Rest calls.

Everything works fine, but now we want to implement integration tests for our custom Rest services.
We do have unit tests that operate over the data extracted from Jira, but this is not enough because in some REST services we are making more than one call to the Jira and we would like to test the logic of retrieving and building up the data we do calculations over.
In an IT test we would like to call the custom REST services with an HTTP client/Spring Rest template and verify the result, but we are still not finding a way to generate and provide a valid JWT token to be used by the test.
Is there anyone having experience with this? How should we generate and register new JWT token that can be set to the request header?

Thanks, Elitza Haltakova

We are at the exact same hurdle, did you ever work out a solution?

You could have a look at atlassian-connect-spring-boot-it-util and how it is used in the library’s own integration tests.