diff --git a/src/test/java/org/gitlab4j/api/TestGitLabApiEvents.java b/src/test/java/org/gitlab4j/api/TestGitLabApiEvents.java index 215fd797..822e35e3 100644 --- a/src/test/java/org/gitlab4j/api/TestGitLabApiEvents.java +++ b/src/test/java/org/gitlab4j/api/TestGitLabApiEvents.java @@ -65,6 +65,12 @@ public static void teardown() { GitLabApi.getLogger().setLevel(savedLevel); } + @Test + public void testDeploymentEvent() throws Exception { + Event event = unmarshalResource(PipelineEvent.class, "deployment-event.json"); + assertTrue(compareJson(event, "deployment-event.json")); + } + @Test public void testIssueEvent() throws Exception { diff --git a/src/test/resources/org/gitlab4j/api/deployment-event.json b/src/test/resources/org/gitlab4j/api/deployment-event.json new file mode 100644 index 00000000..809fbe8d --- /dev/null +++ b/src/test/resources/org/gitlab4j/api/deployment-event.json @@ -0,0 +1,37 @@ +{ + "object_kind": "deployment", + "status": "success", + "status_changed_at":"2021-04-28 21:50:00 +0200", + "deployable_id": 796, + "deployable_url": "http://10.126.0.2:3000/root/test-deployment-webhooks/-/jobs/796", + "environment": "staging", + "project": { + "id": 30, + "name": "test-deployment-webhooks", + "description": "", + "web_url": "http://10.126.0.2:3000/root/test-deployment-webhooks", + "avatar_url": null, + "git_ssh_url": "ssh://vlad@10.126.0.2:2222/root/test-deployment-webhooks.git", + "git_http_url": "http://10.126.0.2:3000/root/test-deployment-webhooks.git", + "namespace": "Administrator", + "visibility_level": 0, + "path_with_namespace": "root/test-deployment-webhooks", + "default_branch": "master", + "ci_config_path": "", + "homepage": "http://10.126.0.2:3000/root/test-deployment-webhooks", + "url": "ssh://vlad@10.126.0.2:2222/root/test-deployment-webhooks.git", + "ssh_url": "ssh://vlad@10.126.0.2:2222/root/test-deployment-webhooks.git", + "http_url": "http://10.126.0.2:3000/root/test-deployment-webhooks.git" + }, + "short_sha": "279484c0", + "user": { + "id": 1, + "name": "Administrator", + "username": "root", + "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "email": "admin@example.com" + }, + "user_url": "http://10.126.0.2:3000/root", + "commit_url": "http://10.126.0.2:3000/root/test-deployment-webhooks/-/commit/279484c09fbe69ededfced8c1bb6e6d24616b468", + "commit_title": "Add new file" +} diff --git a/src/test/resources/org/gitlab4j/api/environment.json b/src/test/resources/org/gitlab4j/api/environment.json index ff77773d..9d2de785 100644 --- a/src/test/resources/org/gitlab4j/api/environment.json +++ b/src/test/resources/org/gitlab4j/api/environment.json @@ -5,6 +5,7 @@ "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com", "state": "available", "tier": "testing", + "auto_stop_at": "2024-11-27T13:34:49.812+01:00", "last_deployment": { "id": 100, "iid": 34,