Integration Test for JIRA Plugin. Tutorials not working, documentation is a joke

Dear Developer,

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?

Regards.

Hey @M.Abdel-Mola,

As far as I can tell there is nothing wrong with FuncTestCase, it’s still available in the API (Jira 7.6.0):
https://docs.atlassian.com/software/jira/docs/api/7.6.0/com/atlassian/jira/functest/framework/FuncTestCase.html

So maybe you are experiencing a maven issue?

Here is it for your Jira version: FuncTestCase (Atlassian JIRA 7.3.6 API)

Cheers,
Peter

Hi, @M.Abdel-Mola.

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)

		<dependency>
			<groupId>com.atlassian.jira</groupId>
			<artifactId>jira-func-tests-legacy</artifactId>
			<version>${jira.version}</version>
			<scope>test</scope>
		</dependency>

Do try it out if it solves your challenges.

Cheers,
Ian

3 Likes

Many thanks @iragudo

This solved my problem and I also removed the old jira-func-tests dependency

1 Like

Hello @iragudo

Can you explain why the jira-func-tests does not contain the class FuncTestCase anymore ? Is there a new way of running integration tests ?

Hi @anon34714063,

Is there a new way of running integration tests?

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.

Hope this helps.
Ian

Thank you @iragudo,

I found some details here : Deprecating JUnit3 test framework

The change in the classes usage seems to be linked to the upgrade from JUnit3 to JUnit4.

1 Like

@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?