use of com.google.copybara.git.github.api.Status in project copybara by google.
the class AbstractGithubApiTest method testCreateStatus.
@Test
public void testCreateStatus() throws Exception {
trainMockPost("/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e", createValidator(TestCreateStatusRequest.class, csr -> csr.getContext().equals("continuous-integration/jenkins") && csr.getState().equals(State.SUCCESS)), getResource("create_status_response_testdata.json"));
Status response = api.createStatus("octocat/Hello-World", "6dcb09b5b57875f334f61aebed695e2e4193db5e", new CreateStatusRequest(State.SUCCESS, "https://ci.example.com/1000/output", "Build has completed successfully", "continuous-integration/jenkins"));
assertThat(response.getContext()).isEqualTo("continuous-integration/jenkins");
assertThat(response.getTargetUrl()).isEqualTo("https://ci.example.com/1000/output");
assertThat(response.getDescription()).isEqualTo("Build has completed successfully");
assertThat(response.getState()).isEqualTo(State.SUCCESS);
assertThat(response.getCreator()).isNotNull();
assertThat(response.getCreator().getLogin()).isEqualTo("octocat");
}
Aggregations