Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestUtil {
- public static User createUser(String login) {
- return new User(login, null,
- login + " name", null, null, null);
- }
- public static List<Repo> createRepos(int count, String owner, String name,
- String description) {
- List<Repo> repos = new ArrayList<>();
- for(int i = 0; i < count; i ++) {
- repos.add(createRepo(owner + i, name + i, description + i));
- }
- return repos;
- }
- public static Repo createRepo(String owner, String name, String description) {
- return createRepo(Repo.UNKNOWN_ID, owner, name, description);
- }
- public static Repo createRepo(int id, String owner, String name, String description) {
- return new Repo(id, name, owner + "/" + name,
- description, new Repo.Owner(owner, null), 3);
- }
- public static Contributor createContributor(Repo repo, String login, int contributions) {
- Contributor contributor = new Contributor(login, contributions, null);
- contributor.setRepoName(repo.name);
- contributor.setRepoOwner(repo.owner.login);
- return contributor;
- }
- }
Add Comment
Please, Sign In to add comment