@JiraBuildNumberDependent(BN_JIRA_5) @Test public void testGetCreateIssueMetadataWithFieldsNotExpanded() throws URISyntaxException { final Iterable<CimProject> metadataProjects = client.getIssueClient().getCreateIssueMetadata(null).claim(); assertEquals(4, Iterables.size(metadataProjects)); final CimProject project = Iterables.find( metadataProjects, new Predicate<CimProject>() { @Override public boolean apply(CimProject input) { return "ANONEDIT".equals(input.getKey()); } }); assertEquals(project.getName(), "Anonymous Editable Project"); assertEquals(5, Iterables.size(project.getIssueTypes())); for (CimIssueType issueType : project.getIssueTypes()) { assertTrue(issueType.getFields().isEmpty()); } }
@JiraBuildNumberDependent(BN_JIRA_5) @Test public void testGetCreateIssueMetadataWithProjectKeyFilter() throws URISyntaxException { final Iterable<CimProject> metadataProjects = client .getIssueClient() .getCreateIssueMetadata( new GetCreateIssueMetadataOptionsBuilder() .withProjectKeys("ANONEDIT", "TST") .withExpandedIssueTypesFields() .build()) .claim(); assertEquals(2, Iterables.size(metadataProjects)); final CimProject project = Iterables.find( metadataProjects, new Predicate<CimProject>() { @Override public boolean apply(CimProject input) { return "TST".equals(input.getKey()); } }); assertEquals(project.getName(), "Test Project"); assertEquals(5, Iterables.size(project.getIssueTypes())); for (CimIssueType issueType : project.getIssueTypes()) { assertFalse(issueType.getFields().isEmpty()); } }
@JiraBuildNumberDependent(BN_JIRA_5) @Test public void testGetCreateIssueMetadata() throws URISyntaxException { final Iterable<CimProject> metadataProjects = client .getIssueClient() .getCreateIssueMetadata( new GetCreateIssueMetadataOptionsBuilder().withExpandedIssueTypesFields().build()) .claim(); assertEquals(4, Iterables.size(metadataProjects)); final CimProject project = Iterables.find( metadataProjects, new Predicate<CimProject>() { @Override public boolean apply(CimProject input) { return "ANONEDIT".equals(input.getKey()); } }); assertEquals(project.getName(), "Anonymous Editable Project"); for (CimIssueType issueType : project.getIssueTypes()) { assertFalse( String.format("Issue type ('%s') fields are not empty!", issueType.getName()), issueType.getFields().isEmpty()); } }