Commit 40a846ff authored by Greg Messner's avatar Greg Messner
Browse files

Added tests for NotificationSettings (#143).

parent a252e37e
...@@ -49,6 +49,7 @@ public class GitLabApi { ...@@ -49,6 +49,7 @@ public class GitLabApi {
private MergeRequestApi mergeRequestApi; private MergeRequestApi mergeRequestApi;
private MilestonesApi milestonesApi; private MilestonesApi milestonesApi;
private NamespaceApi namespaceApi; private NamespaceApi namespaceApi;
private NotificationSettingsApi notificationSettingsApi;
private PipelineApi pipelineApi; private PipelineApi pipelineApi;
private ProjectApi projectApi; private ProjectApi projectApi;
private RepositoryApi repositoryApi; private RepositoryApi repositoryApi;
...@@ -848,6 +849,25 @@ public class GitLabApi { ...@@ -848,6 +849,25 @@ public class GitLabApi {
return (notesApi); return (notesApi);
} }
/**
* Gets the NotesApi instance owned by this GitLabApi instance. The NotesApi is used
* to perform all notes related API calls.
*
* @return the NotesApi instance owned by this GitLabApi instance
*/
public NotificationSettingsApi getNotificationSettingsApi() {
if (notificationSettingsApi == null) {
synchronized (this) {
if (notificationSettingsApi == null) {
notificationSettingsApi = new NotificationSettingsApi(this);
}
}
}
return (notificationSettingsApi);
}
/** /**
* Gets the PipelineApi instance owned by this GitLabApi instance. The PipelineApi is used * Gets the PipelineApi instance owned by this GitLabApi instance. The PipelineApi is used
* to perform all pipeline related API calls. * to perform all pipeline related API calls.
......
...@@ -48,6 +48,7 @@ import org.gitlab4j.api.models.Member; ...@@ -48,6 +48,7 @@ import org.gitlab4j.api.models.Member;
import org.gitlab4j.api.models.MergeRequest; import org.gitlab4j.api.models.MergeRequest;
import org.gitlab4j.api.models.Milestone; import org.gitlab4j.api.models.Milestone;
import org.gitlab4j.api.models.Note; import org.gitlab4j.api.models.Note;
import org.gitlab4j.api.models.NotificationSettings;
import org.gitlab4j.api.models.OauthTokenResponse; import org.gitlab4j.api.models.OauthTokenResponse;
import org.gitlab4j.api.models.Pipeline; import org.gitlab4j.api.models.Pipeline;
import org.gitlab4j.api.models.Project; import org.gitlab4j.api.models.Project;
...@@ -331,6 +332,17 @@ public class TestGitLabApiBeans { ...@@ -331,6 +332,17 @@ public class TestGitLabApiBeans {
} }
} }
@Test
public void testNotificationSettings() {
try {
NotificationSettings settings = makeFakeApiCall(NotificationSettings.class, "notification-settings");
assertTrue(compareJson(settings, "notification-settings"));
} catch (Exception e) {
e.printStackTrace();
}
}
@Test @Test
public void testProject() { public void testProject() {
......
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