mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-01 15:50:48 +00:00
Add code for creating deployments for a repo
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user