Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinSaleschus committed Nov 7, 2024
1 parent a1492ed commit da45db8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/java/org/gitlab4j/api/TestGitLabApiEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
37 changes: 37 additions & 0 deletions src/test/resources/org/gitlab4j/api/deployment-event.json
Original file line number Diff line number Diff line change
@@ -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://[email protected]: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://[email protected]:2222/root/test-deployment-webhooks.git",
"ssh_url": "ssh://[email protected]: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": "[email protected]"
},
"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"
}
1 change: 1 addition & 0 deletions src/test/resources/org/gitlab4j/api/environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit da45db8

Please sign in to comment.