Commits

Paweł Bugalski committed 5fcf1a7

NONE: fixed tests to work with new project self

Comments (0)

Files changed (2)

core/src/main/java/com/atlassian/jira/rest/client/internal/ServerVersionConstants.java

 	public static final int BN_JIRA_4_4 = 640;
 	public static final int BN_JIRA_5 = 700;
 	public static final int BN_JIRA_6 = 6000;
+	public static final int BN_JIRA_6_1 = 6100;
 }

test/src/test/java/it/AsynchronousSearchRestClientTest.java

 
 package it;
 
+import com.atlassian.jira.nimblefunctests.annotation.JiraBuildNumberDependent;
+import com.atlassian.jira.nimblefunctests.annotation.LongCondition;
 import com.atlassian.jira.nimblefunctests.annotation.RestoreOnce;
 import com.atlassian.jira.rest.client.IntegrationTestUtil;
 import com.atlassian.jira.rest.client.TestUtil;
 import java.lang.reflect.InvocationTargetException;
 import java.util.Set;
 
+import static com.atlassian.jira.nimblefunctests.annotation.LongCondition.LESS_THAN;
 import static com.atlassian.jira.rest.client.IntegrationTestUtil.resolveURI;
 import static com.atlassian.jira.rest.client.TestUtil.assertEmptyIterable;
 import static com.atlassian.jira.rest.client.TestUtil.toDateTime;
+import static com.atlassian.jira.rest.client.internal.ServerVersionConstants.BN_JIRA_6;
+import static com.atlassian.jira.rest.client.internal.ServerVersionConstants.BN_JIRA_6_1;
 import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
 import static org.junit.Assert.*;
 
 		});
 	}
 
+	@JiraBuildNumberDependent(value = BN_JIRA_6_1, condition = LESS_THAN)
+	@Test
+	public void jqlSearchShouldReturnIssueWithDetailsBefore6_1() throws InvocationTargetException, IllegalAccessException {
+		jqlSearchShouldReturnIssueWithDetails("rest/api/2/project/TST");
+	}
+
+	@JiraBuildNumberDependent(value = BN_JIRA_6_1)
 	@Test
 	public void jqlSearchShouldReturnIssueWithDetails() throws InvocationTargetException, IllegalAccessException {
+		jqlSearchShouldReturnIssueWithDetails("rest/api/2/project/TST");
+	}
+
+	private void jqlSearchShouldReturnIssueWithDetails(String projectSelf) {
 		final SearchResult searchResult = client.getSearchClient().searchJql("reporter=wseliga").claim();
 		final Issue issue = Iterables.getOnlyElement(searchResult.getIssues());
 
 		assertEquals(toDateTime("2010-09-22T18:06:32.000"), issue.getCreationDate());
 		assertEquals(IntegrationTestUtil.USER1_FULL, issue.getReporter());
 		assertEquals(IntegrationTestUtil.USER_ADMIN_FULL, issue.getAssignee());
-		assertEquals(new BasicProject(resolveURI("rest/api/2/project/TST"), "TST", "Test Project"), issue.getProject());
+		assertEquals(new BasicProject(resolveURI(projectSelf), "TST", "Test Project"), issue.getProject());
 		assertEquals(new BasicVotes(resolveURI("rest/api/2/issue/TST-7/votes"), 0, false), issue.getVotes());
 		assertEquals(new BasicWatchers(resolveURI("rest/api/2/issue/TST-7/watchers"), false, 0), issue.getWatchers());
 		assertEquals(new BasicIssueType(resolveURI("rest/api/2/issuetype/3"), 3L, "Task", false), issue.getIssueType());
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.