Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Possible to mock Jira data in unit tests? Edited

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.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Automation

Announcing the Jira automation template library!

Hi all,  After many months of work, I am delighted to announce the launch of the Jira Automation Template Library!  The Template Library is a new website dedicated to all things Jira au...

1,001 views 17 26
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you