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
117e13a0
Commit
117e13a0
authored
Aug 27, 2017
by
Greg Messner
Browse files
Added test for snippet content.
parent
8caa0a93
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/TestProjectApiSnippets.java
View file @
117e13a0
...
@@ -173,7 +173,7 @@ public class TestProjectApiSnippets {
...
@@ -173,7 +173,7 @@ public class TestProjectApiSnippets {
public
void
testListSnippets
()
throws
GitLabApiException
{
public
void
testListSnippets
()
throws
GitLabApiException
{
String
title
=
TEST_SNIPPET_TITLE_PREFIX
+
"Test listSnippets()"
;
String
title
=
TEST_SNIPPET_TITLE_PREFIX
+
"Test listSnippets()"
;
String
filename
=
"test-
update
-snippet.js"
;
String
filename
=
"test-
list
-snippet
s
.js"
;
String
description
=
null
;
String
description
=
null
;
String
code
=
"window.open();"
;
String
code
=
"window.open();"
;
Visibility
visibility
=
Visibility
.
INTERNAL
;
Visibility
visibility
=
Visibility
.
INTERNAL
;
...
@@ -196,7 +196,7 @@ public class TestProjectApiSnippets {
...
@@ -196,7 +196,7 @@ public class TestProjectApiSnippets {
public
void
testDeleteSnippet
()
throws
GitLabApiException
{
public
void
testDeleteSnippet
()
throws
GitLabApiException
{
String
title
=
TEST_SNIPPET_TITLE_PREFIX
+
"Test listSnippets()"
;
String
title
=
TEST_SNIPPET_TITLE_PREFIX
+
"Test listSnippets()"
;
String
filename
=
"test-
upda
te-snippet.js"
;
String
filename
=
"test-
dele
te-snippet.js"
;
String
description
=
null
;
String
description
=
null
;
String
code
=
"window.open();"
;
String
code
=
"window.open();"
;
Visibility
visibility
=
Visibility
.
INTERNAL
;
Visibility
visibility
=
Visibility
.
INTERNAL
;
...
@@ -214,4 +214,19 @@ public class TestProjectApiSnippets {
...
@@ -214,4 +214,19 @@ public class TestProjectApiSnippets {
}
}
}
}
}
}
@Test
public
void
testSnippetContent
()
throws
GitLabApiException
{
String
title
=
TEST_SNIPPET_TITLE_PREFIX
+
"Test getRawSnippetContent()"
;
String
filename
=
"test-raw-snippet.js"
;
String
description
=
null
;
String
code
=
"window.open();"
;
Visibility
visibility
=
Visibility
.
PUBLIC
;
Snippet
createdSnippet
=
createSnippet
(
title
,
filename
,
description
,
code
,
visibility
);
assertNotNull
(
createdSnippet
);
String
rawContent
=
gitLabApi
.
getProjectApi
().
getRawSnippetContent
(
testProjectId
,
createdSnippet
.
getId
());
assertEquals
(
code
,
rawContent
);
}
}
}
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