As Atlassian guys wrote it on their pages, testing this stuff is not really simple…
You can test licensing-related behavior of your app in a local, development environment to an extent. But there’s no way to replicate the interaction with the UPM and Atlassian Marketplace in a local environment alone. In the production environment, the Atlassian Marketplace serves licenses for new subscribers, and the application interacts with the Marketplace to get the license state.
That is what we did, we just managed req.allowed based on the environment the app was runing on and req.query.lic status. If you want to change license states, you would have to add your addon to private marketplace to generate access token
Installing apps with access tokens
After generating the token, you can use the token URL to install the app and apply the token in the same process:
- Copy your token link from your Private listings page in Marketplace.
- Log into the cloud instance where you want to install your app.
- Go to Manage apps in the administration console.
- Click Settings at the bottom of the page.
- Check the box to Enable private listings .
- Back in the Manage apps page, click Upload app .
- Paste the URL of your descriptor from the Marketplace, and click Upload .
Your descriptor is retrieved and installed, and your token is applied. You should see an “Installed and ready to go!” dialog.
Now you can test your app, modify its license states (if it’s paid), or manage the token. To test, set the license state to the one you want. From the License status menu, choose the state you’d like to test - active trial, subscription, inactive subscription, etc.
One thing to mention here, be careful when uploading to private listing because of the app keys. Apps from private listings can only be removed by filling out the tickets to Atlassian… They are fast tho…
Hope it helped