You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Is there any sort of unit test fixture (besides integration tests) that allow me to create users, issues, and the like in order to create test data in memory for quick and efficient unit testing without waiting for a Jira instance to start?
I'm implementing test fixture mock data manually, such as a test fixture that instantiates a new ApplicationUser or new CustomField, in order to create dummy data for unit testing my Jira plugin (java) backend. Doing so let's me prototype without slowly testing and debugging against a Jira dev server. Each of these Jira data classes mentioned above is an interface with 20 - 50 methods that must be implemented - quite a lot of code! Also, the implementation details I am dangerously guessing, such as how id and name values are set for each class following patterns I detect from REST API calls (e.g. custom field ids seem to start with "customfield_").
I'm happy with my test fixtures - they work, but it's a lot of code and I figured someone else must have done this before enough times to share a fixture? The benefit is developer efficiency with lightning fast unit tests. Starting Jira server locally takes my puny laptop a couple of minutes, then navigating pages can even take 10 - 20 seconds each ;)
I should clarify too - I know how to "mock" (with mockito, Junit) but that is not what I'm asking. Mocks still need to return some kind of data, which is ultimately an Issue, CustomField, or some other Jira data and that is what I'm looking to automate the creation of for testing purposes.