I am experiencing great difficulty making an IssueLink for some mock issues...
to be clear, I am speaking of:
com.atlassian.jira.issue.link.IssueLink
and NOT:
com.atlassian.jira.issue.issuelink.IssueLink
(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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If nobody answers in a few days, I'd really appreciate you accepting my answer, since it is a valid answer to the question (and not relevant to most people that you can't use third party libraries which are actually bundled with the atlassian plugin SDK)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.