aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-tests
diff options
context:
space:
mode:
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>2017-06-01 18:01:20 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-06-20 04:10:53 -0700
commit77b6ed8b18023d7a9b52cc54afbc8a0d0032acb7 (patch)
treef4a882fa30401a9c607971b170fe204c007d2897 /it/it-tests
parent2772ae13b3ff735d5866b7ffd481b40f3867a031 (diff)
downloadsonarqube-77b6ed8b18023d7a9b52cc54afbc8a0d0032acb7.tar.gz
sonarqube-77b6ed8b18023d7a9b52cc54afbc8a0d0032acb7.zip
SONAR-9356 new webservice stub for api/users/skipOnboardingTutorial
Diffstat (limited to 'it/it-tests')
-rw-r--r--it/it-tests/src/test/java/it/Category4Suite.java2
-rw-r--r--it/it-tests/src/test/java/it/user/SkipOnboardingTest.java57
2 files changed, 59 insertions, 0 deletions
diff --git a/it/it-tests/src/test/java/it/Category4Suite.java b/it/it-tests/src/test/java/it/Category4Suite.java
index cbb752d4a71..b9fa1cba83e 100644
--- a/it/it-tests/src/test/java/it/Category4Suite.java
+++ b/it/it-tests/src/test/java/it/Category4Suite.java
@@ -46,6 +46,7 @@ import it.user.ForceAuthenticationTest;
import it.user.LocalAuthenticationTest;
import it.user.MyAccountPageTest;
import it.user.OAuth2IdentityProviderTest;
+import it.user.SkipOnboardingTest;
import it.ws.WsLocalCallTest;
import it.ws.WsTest;
import org.junit.ClassRule;
@@ -65,6 +66,7 @@ import static util.ItUtils.xooPlugin;
// user
MyAccountPageTest.class,
FavoritesWsTest.class,
+ SkipOnboardingTest.class,
// authentication
ForceAuthenticationTest.class,
LocalAuthenticationTest.class,
diff --git a/it/it-tests/src/test/java/it/user/SkipOnboardingTest.java b/it/it-tests/src/test/java/it/user/SkipOnboardingTest.java
new file mode 100644
index 00000000000..3e1ae3e617e
--- /dev/null
+++ b/it/it-tests/src/test/java/it/user/SkipOnboardingTest.java
@@ -0,0 +1,57 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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 it.user;
+
+import com.sonar.orchestrator.Orchestrator;
+import it.Category4Suite;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonarqube.ws.client.WsResponse;
+import util.ItUtils;
+import util.user.UserRule;
+
+import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class SkipOnboardingTest {
+
+ @ClassRule
+ public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
+ @ClassRule
+ public static UserRule userRule = UserRule.from(orchestrator);
+
+ @Test
+ public void should_operate_silently() {
+ String login = randomAlphabetic(10).toLowerCase();
+ String password = randomAlphabetic(10).toLowerCase();
+ userRule.createUser(login, password);
+ WsResponse response;
+ try {
+
+ response = ItUtils.newUserWsClient(orchestrator, null, null).users().skipOnboardingTutorial();
+
+ } finally {
+ userRule.deactivateUsers(login);
+ }
+
+ assertThat(response.code()).isEqualTo(204);
+ assertThat(response.hasContent()).isFalse();
+ }
+}