Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
0179856e
Commit
0179856e
authored
Oct 23, 2019
by
Greg Messner
Browse files
Added content_sha256 field (#455).
parent
09551c7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/RepositoryFile.java
View file @
0179856e
...
@@ -15,6 +15,7 @@ public class RepositoryFile {
...
@@ -15,6 +15,7 @@ public class RepositoryFile {
private
Integer
size
;
private
Integer
size
;
private
Encoding
encoding
;
private
Encoding
encoding
;
private
String
content
;
private
String
content
;
private
String
contentSha256
;
private
String
ref
;
private
String
ref
;
private
String
blobId
;
private
String
blobId
;
private
String
commitId
;
private
String
commitId
;
...
@@ -60,6 +61,14 @@ public class RepositoryFile {
...
@@ -60,6 +61,14 @@ public class RepositoryFile {
this
.
content
=
content
;
this
.
content
=
content
;
}
}
public
String
getContentSha256
()
{
return
contentSha256
;
}
public
void
setContentSha256
(
String
contentSha256
)
{
this
.
contentSha256
=
contentSha256
;
}
public
String
getRef
()
{
public
String
getRef
()
{
return
ref
;
return
ref
;
}
}
...
...
src/test/java/org/gitlab4j/api/TestGitLabApiBeans.java
View file @
0179856e
...
@@ -82,6 +82,7 @@ import org.gitlab4j.api.models.ProtectedBranch;
...
@@ -82,6 +82,7 @@ import org.gitlab4j.api.models.ProtectedBranch;
import
org.gitlab4j.api.models.ProtectedTag
;
import
org.gitlab4j.api.models.ProtectedTag
;
import
org.gitlab4j.api.models.PushRules
;
import
org.gitlab4j.api.models.PushRules
;
import
org.gitlab4j.api.models.RegistryRepository
;
import
org.gitlab4j.api.models.RegistryRepository
;
import
org.gitlab4j.api.models.RepositoryFile
;
import
org.gitlab4j.api.models.Runner
;
import
org.gitlab4j.api.models.Runner
;
import
org.gitlab4j.api.models.RunnerDetail
;
import
org.gitlab4j.api.models.RunnerDetail
;
import
org.gitlab4j.api.models.SearchBlob
;
import
org.gitlab4j.api.models.SearchBlob
;
...
@@ -405,6 +406,12 @@ public class TestGitLabApiBeans {
...
@@ -405,6 +406,12 @@ public class TestGitLabApiBeans {
assertTrue
(
compareJson
(
repos
,
"registry-repositories.json"
));
assertTrue
(
compareJson
(
repos
,
"registry-repositories.json"
));
}
}
@Test
public
void
testRepositoryFile
()
throws
Exception
{
RepositoryFile
file
=
unmarshalResource
(
RepositoryFile
.
class
,
"repository-file.json"
);
assertTrue
(
compareJson
(
file
,
"repository-file.json"
));
}
@Test
@Test
public
void
testRunnerDetail
()
throws
Exception
{
public
void
testRunnerDetail
()
throws
Exception
{
RunnerDetail
runnerDetail
=
unmarshalResource
(
RunnerDetail
.
class
,
"runner-detail.json"
);
RunnerDetail
runnerDetail
=
unmarshalResource
(
RunnerDetail
.
class
,
"runner-detail.json"
);
...
...
src/test/resources/org/gitlab4j/api/repository-file.json
0 → 100644
View file @
0179856e
{
"file_name"
:
"key.rb"
,
"file_path"
:
"app/models/key.rb"
,
"size"
:
1476
,
"encoding"
:
"base64"
,
"content"
:
"IyA9PSBTY2hlbWEgSW5mb3..."
,
"content_sha256"
:
"4c294617b60715c1d218e61164a3abd4808a4284cbc30e6728a01ad9aada4481"
,
"ref"
:
"master"
,
"blob_id"
:
"79f7bbd25901e8334750839545a9bd021f0e4c83"
,
"commit_id"
:
"d5a3ff139356ce33e37e73add446f16869741b50"
,
"last_commit_id"
:
"570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment