I want to write a integration test for my plugin. I tried to find out how to manage integration tests for JIRA Plugins, but your documentation is (as always) not up to date. When I google “JIRA 7 Plugin integration tests” the first link is a tutorial of Atlassian. So when you decide to write a public tutorial about ANY topic of your OWN technologie you are bound to keep it up to date.
So I hope anyone can answer now just a simple question…I tried to write a test like in this tutorial.
But when I want to extend from “FuncTestCase” I can’t find it under the package “com.atlassian.jira.functest.framework.FuncTestCase”
My question right now: Why can’t I find the FuncTestCase class? I can find “FuncTestSuite” and many other classes but not the FuncTestCase…
Here my pom with the dependencies:
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-func-tests</artifactId>
<version>${jira.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira.tests</groupId>
<artifactId>jira-testkit-client</artifactId>
<version>${testkit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>atlassian-jira-pageobjects</artifactId>
<version>${jira.version}</version>
<scope>test</scope>
<exclusions>
<!-- excluded due to clash with other SLF implementation -->
<exclusion>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<properties>
<jira.version>7.3.6</jira.version>
<testkit.version>7.2.11</testkit.version>
</properties>
What is missing? What is wrong? Is FuncTestCase deprecated? If its deprecated, why is it still at the developer documentation?
I have checked on your concern and was able to replicate the issue. The class you need was moved to a different artifact. Kindly use the following dependency (I tried it and it works as expected)
Personally, I use the generated integration test as a starting point after running atlas-create-<product>-plugin via calling atlas-integration-test. It creates a component wired test class annotated with @RunWith(AtlassianPluginsTestRunner.class). For more information regarding this, please check this documentation.
@anon34714063 Is there an example unit test with the new Junit4?
What I’m looking for is a simple test fixture that creates a user, some issues, custom fields etc on the fly in order to test my backend java code.
I suppose I could reverse engineer creating these things myself, but then I’d be assuming how these things are getting setup that may not match the production Jira implementation. For instance, perhaps certain String ID fields are set a way I ignore in my test fixtures - so that is why I was hoping for a Jira API to create mock data for me. Does this exist?