I am experiencing great difficulty making an IssueLink for some mock issues...
to be clear, I am speaking of:
(which seems to have little purpose in 4.4, but much more in 5.x)
I am looking for a simple, straight forward, non-spring, pojo-esque approach to getting an IssueLink for my junits. even a way to create a from scratch GenericValue that would define/encapsulate an IssueLink would be helpful.
Thank you :)
Have you considered creating actual mock objects? Mockito, jMock, and Easymock all make this pretty easy.
IssueLink issueLink = Mockito.mock(IssueLink.class); Mockito.when(issueLink.getId()).thenReturn(123L); Mockito.when(issueLink.someOtherMethod(args)).thenReturn(answer);
You can then pass the issueLink object around for your tests. For details about Mockito (my preferred mock library) see: http://code.google.com/p/mockito/
lets just say there is more red tape than usual around this specific project. Downloading FOSS tools, I.E. Mockito, is not permitted.
As I'm sure you are aware, the IssueLink type is NOT an interface. My end scenario has to involve using only JUnit and JIRA 4.4 API.
Basically, I'm looking for an easy way to Unit Test Issue Link lookups without having to write some strange/convoluted hack to get around the existing infrastructure.
if Jira 4.4 API is not capable of this in a simple fashioned, a solid explanation of WHY would get you an answer awarded, preferably by someone with a respectable karma tally.
Yeah, I can't speak definitively about the Jira 4.4 API, hopefully someone else can. Sorry to hear about the red tape, I really hate that =( For what it's worth, the Atlassian Plugin SDK comes with Mockito built in I think (at least, it isn't listed in my POM anywhere, it "just works") so you might already have it just the same.
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork? We've compiled a list here, along with...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs