Add code for creating deployments for a repo

This commit is contained in:
Surya Gaddipati
2014-12-19 12:47:00 -06:00
parent af3099c526
commit a2fa526aa0
4 changed files with 70 additions and 28 deletions

View File

@@ -1,22 +1,16 @@
package org.kohsuke.github;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import org.junit.Assume;
import org.junit.Test;
import org.kohsuke.github.GHCommit.File;
import org.kohsuke.github.GHOrganization.Permission;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import java.io.IOException;
import java.net.URL;
import java.util.*;
import java.util.Map.Entry;
/**
* Unit test for simple App.
@@ -82,6 +76,19 @@ public class AppTest extends AbstractGitHubApiTestBase {
o.close();
}
@Test
public void testCreateDeployment() throws IOException {
GHUser u = getUser();
GHRepository repository = getTestRepository();
//GHMilestone milestone = repository.createMilestone(System.currentTimeMillis() + "", "Test Milestone");
GHDeployment o = repository.createDeployment()
.ref("master")
.payload("{\"user\":\"atmos\",\"room_id\":123456}")
.description("question")
.create();
assertNotNull(o);
}
@Test
public void testGetIssues() throws Exception {
List<GHIssue> closedIssues = gitHub.getUser("kohsuke").getRepository("github-api").getIssues(GHIssueState.CLOSED);