Package com.taskadapter.redmineapi

Source Code of com.taskadapter.redmineapi.IssueHelper

package com.taskadapter.redmineapi;

import com.taskadapter.redmineapi.bean.Issue;
import com.taskadapter.redmineapi.bean.IssueFactory;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;

public class IssueHelper {
    public static List<Issue> createIssues(IssueManager issueManager, String projectKey, int issuesNumber) throws RedmineException {
        List<Issue> issues = new ArrayList<Issue>(issuesNumber);
        for (int i = 0; i < issuesNumber; i++) {
            Issue issueToCreate = IssueFactory.createWithSubject("some issue " + i + " " + new Date());
            Issue issue = issueManager.createIssue(projectKey, issueToCreate);
            issues.add(issue);
        }
        return issues;
    }

    public static Issue generateRandomIssue() {
        Random r = new Random();
        return IssueFactory.createWithSubject("some issue " + r.nextInt() + " " + new Date());
    }
}
TOP

Related Classes of com.taskadapter.redmineapi.IssueHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.