Commit cbc27b66 authored by Jeremie Bresson's avatar Jeremie Bresson
Browse files

Merge remote-tracking branch 'origin/main' into 6.x

parents 45d6da03 80abfcae
...@@ -2,6 +2,8 @@ package org.gitlab4j.api.systemhooks; ...@@ -2,6 +2,8 @@ package org.gitlab4j.api.systemhooks;
import org.gitlab4j.api.webhook.MergeRequestEvent; import org.gitlab4j.api.webhook.MergeRequestEvent;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class MergeRequestSystemHookEvent extends MergeRequestEvent implements SystemHookEvent { public class MergeRequestSystemHookEvent extends MergeRequestEvent implements SystemHookEvent {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -9,6 +11,7 @@ public class MergeRequestSystemHookEvent extends MergeRequestEvent implements Sy ...@@ -9,6 +11,7 @@ public class MergeRequestSystemHookEvent extends MergeRequestEvent implements Sy
public static final String MERGE_REQUEST_EVENT = "merge_request"; public static final String MERGE_REQUEST_EVENT = "merge_request";
private String eventType; private String eventType;
private String eventName;
@Override @Override
public String getObjectKind() { public String getObjectKind() {
...@@ -17,14 +20,28 @@ public class MergeRequestSystemHookEvent extends MergeRequestEvent implements Sy ...@@ -17,14 +20,28 @@ public class MergeRequestSystemHookEvent extends MergeRequestEvent implements Sy
@Override @Override
public String getEventName() { public String getEventName() {
return (MERGE_REQUEST_EVENT); return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
} }
public String getEventType() { public String getEventType() {
return eventType; return eventType;
} }
public void setEventType(String eventType) {
this.eventType = eventType;
}
/**
* @deprecated use {@link #setEventType(String)} instead
* @param eventType
*/
@Deprecated
@JsonIgnore
public void setEvent_type(String eventType) { public void setEvent_type(String eventType) {
this.eventType = eventType; setEventType(eventType);
} }
} }
...@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Assertions; ...@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Assertions;
import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.MapperFeature;
...@@ -34,6 +35,7 @@ public class JsonUtils { ...@@ -34,6 +35,7 @@ public class JsonUtils {
jacksonJson = new JacksonJson(); jacksonJson = new JacksonJson();
jacksonJson.getObjectMapper().configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); jacksonJson.getObjectMapper().configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
jacksonJson.getObjectMapper().configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true); jacksonJson.getObjectMapper().configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
jacksonJson.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
} }
static JsonNode readTreeFromMap(Map<String, Object> map) throws JsonParseException, JsonMappingException, IOException { static JsonNode readTreeFromMap(Map<String, Object> map) throws JsonParseException, JsonMappingException, IOException {
......
{ {
"commit": { "commit": {
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", "author_email": "john@example.com",
"parents": [{ "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8" }], "author_name": "John Smith",
"tree": "46e82de44b1061621357f24c05515327f2795a95", "authored_date": "2012-06-27T05:51:39Z",
"message": "add projects API", "committed_date": "2012-06-28T03:44:20Z",
"author": { "committer_email": "john@example.com",
"name": "John Smith", "committer_name": "John Smith",
"email": "john@example.com" "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
}, "short_id": "7b5c3cc",
"committer": { "title": "add projects API",
"name": "John Smith", "message": "add projects API",
"email": "john@example.com" "parent_ids": [
}, "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
"authored_date": "2012-06-27T12:51:39Z", ]
"committed_date": "2012-06-28T10:44:20Z" },
}, "protected": true
"protected": true
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment