aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src/test
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-11-10 17:13:37 +0100
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-11-18 11:17:01 +0100
commit6cd23f9e6c49c4731da4c878c9891dd3cec8d08d (patch)
tree8f37c5c9dea4d901a0fb5b78c809c5d989c90414 /sonar-batch/src/test
parent7ec598b6d81cae1840600431f1809cd38ec79c3a (diff)
downloadsonarqube-6cd23f9e6c49c4731da4c878c9891dd3cec8d08d.tar.gz
sonarqube-6cd23f9e6c49c4731da4c878c9891dd3cec8d08d.zip
SONAR-7008 Call to batch/project WS not encoding parameters
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java
index 6c63d0545dc..0a9e4bf678b 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/rule/DefaultActiveRulesLoaderTest.java
@@ -20,7 +20,6 @@
package org.sonar.batch.rule;
import org.sonar.api.rule.RuleKey;
-
import org.sonar.batch.cache.WSLoaderResult;
import org.sonar.batch.cache.WSLoader;
import com.google.common.io.Resources;
@@ -48,16 +47,16 @@ public class DefaultActiveRulesLoaderTest {
}
@Test
- public void feed_real_response() throws IOException {
+ public void feed_real_response_encode_qp() throws IOException {
InputStream response1 = loadResource("active_rule_search1.protobuf");
InputStream response2 = loadResource("active_rule_search2.protobuf");
- String req1 = "/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=java-sonar-way-26368&p=1&ps=500";
- String req2 = "/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=java-sonar-way-26368&p=2&ps=500";
+ String req1 = "/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=c%2B-test_c%2B-values-17445&p=1&ps=500";
+ String req2 = "/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives&activation=true&qprofile=c%2B-test_c%2B-values-17445&p=2&ps=500";
when(ws.loadStream(req1)).thenReturn(new WSLoaderResult<InputStream>(response1, false));
when(ws.loadStream(req2)).thenReturn(new WSLoaderResult<InputStream>(response2, false));
- Collection<LoadedActiveRule> activeRules = loader.load("java-sonar-way-26368", null);
+ Collection<LoadedActiveRule> activeRules = loader.load("c+-test_c+-values-17445", null);
assertThat(activeRules).hasSize(226);
assertActiveRule(activeRules);
@@ -65,7 +64,7 @@ public class DefaultActiveRulesLoaderTest {
verify(ws).loadStream(req2);
verifyNoMoreInteractions(ws);
}
-
+
private static void assertActiveRule(Collection<LoadedActiveRule> activeRules) {
RuleKey key = RuleKey.of("squid", "S3008");
for (LoadedActiveRule r : activeRules) {