mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 15:50:52 +00:00
Merge branch 'master' into AffiliationFilter
This commit is contained in:
@@ -180,6 +180,9 @@ public class AppTest extends AbstractGitHubWireMockTest {
|
||||
assertFalse(Iterables.isEmpty(deployments));
|
||||
GHDeployment unitTestDeployment = deployments.get(0);
|
||||
assertEquals("unittest", unitTestDeployment.getEnvironment());
|
||||
assertEquals("unittest", unitTestDeployment.getOriginalEnvironment());
|
||||
assertEquals(false, unitTestDeployment.isProductionEnvironment());
|
||||
assertEquals(true, unitTestDeployment.isTransientEnvironment());
|
||||
assertEquals("master", unitTestDeployment.getRef());
|
||||
}
|
||||
|
||||
@@ -191,14 +194,23 @@ public class AppTest extends AbstractGitHubWireMockTest {
|
||||
.description("question")
|
||||
.payload("{\"user\":\"atmos\",\"room_id\":123456}")
|
||||
.create();
|
||||
GHDeploymentStatus ghDeploymentStatus = deployment.createStatus(GHDeploymentState.SUCCESS)
|
||||
GHDeploymentStatus ghDeploymentStatus = deployment.createStatus(GHDeploymentState.QUEUED)
|
||||
.description("success")
|
||||
.targetUrl("http://www.github.com")
|
||||
.logUrl("http://www.github.com/logurl")
|
||||
.environmentUrl("http://www.github.com/envurl")
|
||||
.environment("new-ci-env")
|
||||
.create();
|
||||
Iterable<GHDeploymentStatus> deploymentStatuses = deployment.listStatuses();
|
||||
assertNotNull(deploymentStatuses);
|
||||
assertEquals(1, Iterables.size(deploymentStatuses));
|
||||
assertEquals(ghDeploymentStatus.getId(), Iterables.get(deploymentStatuses, 0).getId());
|
||||
GHDeploymentStatus actualStatus = Iterables.get(deploymentStatuses, 0);
|
||||
assertEquals(ghDeploymentStatus.getId(), actualStatus.getId());
|
||||
assertEquals(ghDeploymentStatus.getState(), actualStatus.getState());
|
||||
assertEquals(ghDeploymentStatus.getLogUrl(), actualStatus.getLogUrl());
|
||||
// Target url was deprecated and replaced with log url. The gh api will
|
||||
// prefer the log url value and return it in place of target url.
|
||||
assertEquals(ghDeploymentStatus.getTargetUrl(), actualStatus.getLogUrl());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -23,6 +23,9 @@ public class GHDeploymentTest extends AbstractGitHubWireMockTest {
|
||||
assertEquals("master", deployment.getRef());
|
||||
assertEquals("3a09d2de4a9a1322a0ba2c3e2f54a919ca8fe353", deployment.getSha());
|
||||
assertEquals("deploy", deployment.getTask());
|
||||
assertEquals("production", deployment.getOriginalEnvironment());
|
||||
assertEquals(false, deployment.isProductionEnvironment());
|
||||
assertEquals(true, deployment.isTransientEnvironment());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -41,6 +44,9 @@ public class GHDeploymentTest extends AbstractGitHubWireMockTest {
|
||||
assertEquals("two", payload.get("custom2"));
|
||||
assertEquals(Arrays.asList("3", 3, "three"), payload.get("custom3"));
|
||||
assertNull(payload.get("custom4"));
|
||||
assertEquals("production", deployment.getOriginalEnvironment());
|
||||
assertEquals(false, deployment.isProductionEnvironment());
|
||||
assertEquals(true, deployment.isTransientEnvironment());
|
||||
}
|
||||
|
||||
protected GHRepository getRepository() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user