The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use backdoor in integration tests with 8.x.x?

Markus_COGNITIFF
Contributor
August 28, 2019

I am trying to set up integration tests with v. 8.1.11. PageObjects works fine, but Backdoor doesn't. Every backdoor operation throws a 404. Here is the test:

```
package it.hk.com.epictechnology.plugins.rest;

import com.atlassian.jira.pageobjects.JiraTestedProduct;
import com.atlassian.jira.pageobjects.pages.admin.ViewProjectsPage;
import com.atlassian.pageobjects.TestedProductFactory;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class RerankRequestControllerFuncTest {

public JiraTestedProduct jira = TestedProductFactory.create(JiraTestedProduct.class);

@Before
public void setup () {
jira.backdoor().subtask().enable();
}

@techoneway
public void projectCountIsValid() {
ViewProjectsPage viewProjects = jira.gotoLoginPage().loginAsSysAdmin(ViewProjectsPage.class);
assertEquals(1, viewProjects.getProjects().size());
}
}
```

This is the error:

```
<testcase name="projectCountIsValid" classname="it.hk.com.epictechnology.plugins.rest.RerankRequestControllerFuncTest" time="2.358">
<error message="Client response status: 404" type="com.sun.jersey.api.client.UniformInterfaceException">com.sun.jersey.api.client.UniformInterfaceException: Client response status: 404
at it.hk.com.epictechnology.plugins.rest.RerankRequestControllerFuncTest.setup(RerankRequestControllerFuncTest.java:24)
</error>
<system-out><![CDATA[ . Backdoor POST in 1086ms /subtask
]]></system-out>
</testcase>
```

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Nhac Tat Nguyen
Contributor
November 13, 2019

Which version of Jira Testkit are you using? Can you post your pom file as well!