Skip to content

Add sha256 field in package file #1141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/org/gitlab4j/api/models/PackageFile.java
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a value in the example file package-files.json. This way we are sure the serialisation/deserialisation code works (tested in the TestGitLabApiBeans unit test)

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class PackageFile implements Serializable {
private Long size;
private String fileMd5;
private String fileSha1;
private String fileSha256;

public Long getId() {
return id;
Expand Down Expand Up @@ -93,6 +94,14 @@ public void setFileSha1(String fileSha1) {
this.fileSha1 = fileSha1;
}

public String getFileSha256() {
return fileSha256;
}

public void setFileSha256(String fileSha256) {
this.fileSha256 = fileSha256;
}

@Override
public String toString() {
return (JacksonJson.toJsonString(this));
Expand Down
9 changes: 6 additions & 3 deletions src/test/resources/org/gitlab4j/api/package-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"file_name": "my-app-1.5-20181107.152550-1.jar",
"size": 2421,
"file_md5": "58e6a45a629910c6ff99145a688971ac",
"file_sha1": "ebd193463d3915d7e22219f52740056dfd26cbfe"
"file_sha1": "ebd193463d3915d7e22219f52740056dfd26cbfe",
"file_sha256": "e677d33156215f1afa15c934a4ebd1162c62d0ae0e70d2510b6bc75e651c27b8"
},
{
"id": 26,
Expand All @@ -15,7 +16,8 @@
"file_name": "my-app-1.5-20181107.152550-1.pom",
"size": 1122,
"file_md5": "d90f11d851e17c5513586b4a7e98f1b2",
"file_sha1": "9608d068fe88aff85781811a42f32d97feb440b5"
"file_sha1": "9608d068fe88aff85781811a42f32d97feb440b5",
"file_sha256": "621dc7c0a151ab80895237868421eb5708c5285bf88b5ceeac3d77d5be11512b"
},
{
"id": 27,
Expand All @@ -24,6 +26,7 @@
"file_name": "maven-metadata.xml",
"size": 767,
"file_md5": "6dfd0cce1203145a927fef5e3a1c650c",
"file_sha1": "d25932de56052d320a8ac156f745ece73f6a8cd2"
"file_sha1": "d25932de56052d320a8ac156f745ece73f6a8cd2",
"file_sha256": "c3e051898b0fb347553424d7947127905b4649961463f8627003f5ce7a6f750c"
}
]
Loading