use of com.google.copybara.git.github.api.Issue.CreateIssueRequest in project copybara by google.
the class AbstractGitHubApiTest method testCreateIssue.
@Test
public void testCreateIssue() throws Exception {
trainMockPost("/repos/example/project/issues", createValidator(TestCreateIssueRequest.class, (ci) -> ci.getTitle().equals("[TEST] example pull request one") && ci.getBody().equals("Example body.\n") && ci.getAssignees().equals(ImmutableList.of("foo", "bar"))), getResource("issues_12345_testdata.json"));
Issue issue = api.createIssue("example/project", new CreateIssueRequest("[TEST] example pull request one", "Example body.\n", ImmutableList.of("foo", "bar")));
assertThat(issue.getNumber()).isEqualTo(12345);
assertThat(issue.getState()).isEqualTo("open");
assertThat(issue.getTitle()).isEqualTo("[TEST] example pull request one");
assertThat(issue.getBody()).isEqualTo("Example body.\r\n");
}
Aggregations