How to add an integration test?

Disclamer: clearly this could (and should) be done in a unit-test, but it’s created as a minimum example, as I’m struggling with the complete basics of how to reference a class from an integration test. The example in the plugin tutorials simply references the boilerplate test already present, and event the part about adding a “traditional integration test” simply does a println and an bogus assert.

To create the minimum example, I’ve created a new plugin with atlas-create-jira-plugin.

I have this basic class: HelperClass containing:


public class HelperClass {

    private String name;

    public HelperClass(String name) { = name;

    public String getName(){
        return name;

    public void setName(String name){ = name;


I would like to write a test for this that sets a state, reads it, changes the state and validates that the state has been changed. HelperClassTest contains:


import com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertFalse;

public class HelperClassTest {

    public void someTest()
        // Arrange
        HelperClass hc = new HelperClass("somestring");
        String before = hc.getName();

        // Act
        String after = hc.getName();

        // Assert
        assertFalse("The name hasn't changed!", before.equals(after));


If I just run atlas-integration-test, I get an error NoClassDefFoundError for HelperClass. On Google I found the article: NoClassDefFoundError. It says to “make sure the class and package name are correct and that the class is declared as a component in its atlassian-plugin.xml .”

  • The class and package name is correct. The class is called HelperClass and it’s in the package which is imported with import;.
  • When I add it as a component in atlassian-plugin.xml like below: (full atlassian-plugin.xml-file in the bottom)
<component key="helperClass" class="" />

however, I get another error:

  No tests found in class []: No tests found in class []

With the stack trace:

 T E S T S
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
[INFO] [talledLocalContainer] jan. 09, 2019 3:38:21 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
[INFO] [talledLocalContainer] INFO: Initiating Jersey application, version 'Jersey: 1.19 02/11/2015 03:25 AM'
[INFO] [talledLocalContainer] jan. 09, 2019 3:38:21 PM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
[INFO] [talledLocalContainer] INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
[INFO] [talledLocalContainer] jan. 09, 2019 3:38:21 PM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
[INFO] [talledLocalContainer] INFO: Loading wadlGenerator
[INFO] [talledLocalContainer] jan. 09, 2019 3:38:21 PM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
[INFO] [talledLocalContainer] INFO: Loading wadlGenerator
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.286 sec <<< FAILURE!
No tests found in class []  Time elapsed: 2.285 sec  <<< ERROR!
java.lang.Exception: No tests found in class []
        at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.runViaRestCall(
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
        at org.apache.maven.surefire.booter.ForkedBooter.main(

My atlassian-plugin.xml-file looks like this:

<atlassian-plugin key="${project.groupId}.${project.artifactId}-tests" name="${}" plugins-version="2">
        <vendor name="${}" url="${project.organization.url}" />

    <!-- from our base plugin -->
    <component-import key="myComponent" interface=""/>

    <!-- from the product container -->
    <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />

    <component key="helperClass" class="" />


And my project structure looks like this:

Any advice would be helpful.

PS: I know that the above test should just be a unit-test, but it’s created as a minimum example of “an integration test that is not being picked up by junit.”