diff options
author | Daniel Schwarz <daniel.schwarz@sonarsource.com> | 2017-06-27 14:06:33 +0200 |
---|---|---|
committer | Daniel Schwarz <bartfastiel@users.noreply.github.com> | 2017-08-09 15:09:54 +0200 |
commit | e4999c7a0052963405bb2c63df926950bc2ca2cc (patch) | |
tree | 06220cefd4e57b7c4a2fb44c722ee4eb02f88c11 /server/sonar-server/src | |
parent | e83e94631449a2809f4acdccbdeb4429e9c269e9 (diff) | |
download | sonarqube-e4999c7a0052963405bb2c63df926950bc2ca2cc.tar.gz sonarqube-e4999c7a0052963405bb2c63df926950bc2ca2cc.zip |
SONAR-8798 do not reference non existing field in queries
Diffstat (limited to 'server/sonar-server/src')
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/component/index/ComponentIndexFeatureFavoriteTest.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/index/ComponentIndexFeatureFavoriteTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/index/ComponentIndexFeatureFavoriteTest.java index 8e5156aad0c..e37db705eeb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/index/ComponentIndexFeatureFavoriteTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/index/ComponentIndexFeatureFavoriteTest.java @@ -30,6 +30,7 @@ import static java.util.Collections.singletonList; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.sonar.api.resources.Qualifiers.PROJECT; +import static org.sonar.server.component.index.ComponentIndexDefinition.FIELD_KEY; public class ComponentIndexFeatureFavoriteTest extends ComponentIndexTest { @@ -60,7 +61,7 @@ public class ComponentIndexFeatureFavoriteTest extends ComponentIndexTest { @Test public void irrelevant_favorites_are_not_returned() { - features.set(q -> termQuery("non-existing-field", "non-existing-value"), ComponentTextSearchFeatureRepertoire.FAVORITE); + features.set(q -> termQuery(FIELD_KEY, "non-existing-value"), ComponentTextSearchFeatureRepertoire.FAVORITE); ComponentDto project1 = indexProject("foo", "foo"); ComponentIndexQuery query1 = ComponentIndexQuery.builder() |