diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-12-16 11:05:21 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-12-19 10:12:50 +0100 |
commit | 3a3bf3073419bc6c21a67965a9f8259dbb164fc6 (patch) | |
tree | 70c9e66145034921e5e8003f7bad21b352912719 /sonar-ws/src/test | |
parent | 7f7ebdb0510b26cf861b6eae66d11b63d98bfcd1 (diff) | |
download | sonarqube-3a3bf3073419bc6c21a67965a9f8259dbb164fc6.tar.gz sonarqube-3a3bf3073419bc6c21a67965a9f8259dbb164fc6.zip |
SONAR-7287 Create WS api/favorites/add
Diffstat (limited to 'sonar-ws/src/test')
-rw-r--r-- | sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java new file mode 100644 index 00000000000..4b6c8a40feb --- /dev/null +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/favorite/FavoritesServiceTest.java @@ -0,0 +1,46 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.sonarqube.ws.client.favorite; + +import org.junit.Rule; +import org.junit.Test; +import org.sonarqube.ws.client.ServiceTester; +import org.sonarqube.ws.client.WsConnector; + +import static org.mockito.Mockito.mock; +import static org.sonarqube.ws.client.favorite.FavoritesWsParameters.PARAM_COMPONENT; + +public class FavoritesServiceTest { + @Rule + public ServiceTester<FavoritesService> serviceTester = new ServiceTester<>(new FavoritesService(mock(WsConnector.class))); + + private FavoritesService underTest = serviceTester.getInstanceUnderTest(); + + @Test + public void add() { + underTest.add("my_project"); + + serviceTester.assertThat(serviceTester.getPostRequest()) + .hasPath("add") + .hasParam(PARAM_COMPONENT, "my_project") + .andNoOtherParam(); + } +} |