Guest User

Untitled

a guest
Oct 20th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public class TestUtil {
  2.  
  3. public static User createUser(String login) {
  4. return new User(login, null,
  5. login + " name", null, null, null);
  6. }
  7.  
  8. public static List<Repo> createRepos(int count, String owner, String name,
  9. String description) {
  10. List<Repo> repos = new ArrayList<>();
  11. for(int i = 0; i < count; i ++) {
  12. repos.add(createRepo(owner + i, name + i, description + i));
  13. }
  14. return repos;
  15. }
  16.  
  17. public static Repo createRepo(String owner, String name, String description) {
  18. return createRepo(Repo.UNKNOWN_ID, owner, name, description);
  19. }
  20.  
  21. public static Repo createRepo(int id, String owner, String name, String description) {
  22. return new Repo(id, name, owner + "/" + name,
  23. description, new Repo.Owner(owner, null), 3);
  24. }
  25.  
  26. public static Contributor createContributor(Repo repo, String login, int contributions) {
  27. Contributor contributor = new Contributor(login, contributions, null);
  28. contributor.setRepoName(repo.name);
  29. contributor.setRepoOwner(repo.owner.login);
  30. return contributor;
  31. }
  32. }
Add Comment
Please, Sign In to add comment