aboutsummaryrefslogtreecommitdiffstats
path: root/it/it-tests
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-05 17:52:55 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-06 13:35:57 +0100
commitdc4b076e6f48f2db09d33b45e96ad703da3bc893 (patch)
treec9c3b9574d0a41970ea13028b130c81b569732b1 /it/it-tests
parentd005cac9894de917bb86ffbc5755500155c97cad (diff)
downloadsonarqube-dc4b076e6f48f2db09d33b45e96ad703da3bc893.tar.gz
sonarqube-dc4b076e6f48f2db09d33b45e96ad703da3bc893.zip
SONAR-8438 New web service api/system/ping
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/serverSystem/PingTest.java43
2 files changed, 45 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 db87ef57d3c..897cf0b023e 100644
--- a/it/it-tests/src/test/java/it/Category4Suite.java
+++ b/it/it-tests/src/test/java/it/Category4Suite.java
@@ -35,6 +35,7 @@ import it.projectSearch.SearchProjectsTest;
import it.qualityProfile.QualityProfilesPageTest;
import it.serverSystem.HttpHeadersTest;
import it.serverSystem.LogsTest;
+import it.serverSystem.PingTest;
import it.serverSystem.ServerSystemTest;
import it.ui.SourceViewerTest;
import it.ui.UiTest;
@@ -58,6 +59,7 @@ import static util.ItUtils.xooPlugin;
@Suite.SuiteClasses({
// server system
ServerSystemTest.class,
+ PingTest.class,
// user
MyAccountPageTest.class,
FavoritesWsTest.class,
diff --git a/it/it-tests/src/test/java/it/serverSystem/PingTest.java b/it/it-tests/src/test/java/it/serverSystem/PingTest.java
new file mode 100644
index 00000000000..41cf78b8a5c
--- /dev/null
+++ b/it/it-tests/src/test/java/it/serverSystem/PingTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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 it.serverSystem;
+
+import com.sonar.orchestrator.Orchestrator;
+import it.Category4Suite;
+import okhttp3.Response;
+import org.junit.ClassRule;
+import org.junit.Test;
+import util.ItUtils;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class PingTest {
+
+ @ClassRule
+ public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
+
+ @Test
+ public void ping_answers_pong() throws Exception {
+ Response response = ItUtils.call(orchestrator.getServer().getUrl() + "/api/system/ping");
+
+ assertThat(response.body().string()).isEqualTo("pong");
+ assertThat(response.header("Content-Type")).isEqualTo("text/plain");
+ }
+}