Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Aniszczyk2011-04-19 22:09:14 +0000
committerCode Review2011-04-19 22:09:14 +0000
commitfb10beddd4fb7f153420eb5f68850319ff5861b6 (patch)
tree9c54903575656d5cc81f78548de9fb297227d1cc /org.eclipse.mylyn.github.core
parent71d3ea86a0e34b3da7ee3e0672d4bbc21b16f742 (diff)
parent1a19ef58647087ce594a5040c78caf72458e204e (diff)
downloadegit-github-fb10beddd4fb7f153420eb5f68850319ff5861b6.tar.gz
egit-github-fb10beddd4fb7f153420eb5f68850319ff5861b6.tar.xz
egit-github-fb10beddd4fb7f153420eb5f68850319ff5861b6.zip
Merge "Unit tests for LabelService"
Diffstat (limited to 'org.eclipse.mylyn.github.core')
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelService.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelService.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelService.java
index 9ce5d471..6b243713 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelService.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/LabelService.java
@@ -45,6 +45,8 @@ public class LabelService {
*/
public List<Label> getLabels(String user, String repository)
throws IOException {
+ Assert.isNotNull(user, "User cannot be null"); //$NON-NLS-1$
+ Assert.isNotNull(repository, "Repository cannot be null"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(IGitHubConstants.SEGMENT_REPOS);
uri.append('/').append(user).append('/').append(repository);
uri.append(IGitHubConstants.SEGMENT_LABELS).append(
@@ -66,6 +68,9 @@ public class LabelService {
*/
public List<Label> setLabels(String user, String repository,
String issueId, List<Label> labels) throws IOException {
+ Assert.isNotNull(user, "User cannot be null"); //$NON-NLS-1$
+ Assert.isNotNull(repository, "Repository cannot be null"); //$NON-NLS-1$
+ Assert.isNotNull(issueId, "Issue id cannot be null"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(IGitHubConstants.SEGMENT_REPOS);
uri.append('/').append(user).append('/').append(repository);
uri.append(IGitHubConstants.SEGMENT_ISSUES).append('/').append(issueId);
@@ -88,6 +93,9 @@ public class LabelService {
*/
public Label createLabel(String user, String repository, Label label)
throws IOException {
+ Assert.isNotNull(user, "User cannot be null"); //$NON-NLS-1$
+ Assert.isNotNull(repository, "Repository cannot be null"); //$NON-NLS-1$
+ Assert.isNotNull(label, "Label cannot be null"); //$NON-NLS-1$
StringBuilder uri = new StringBuilder(IGitHubConstants.SEGMENT_REPOS);
uri.append('/').append(user).append('/').append(repository);
uri.append(IGitHubConstants.SEGMENT_LABELS).append(

Back to the top