aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2021-03-11 14:51:09 +0100
committersonartech <sonartech@sonarsource.com>2021-03-18 20:08:12 +0000
commitdab939698e737075f7e9467552911a2591f3e846 (patch)
tree823be5eb113a496ad8979de3035b080da9e11e25 /sonar-testing-harness
parent66249573d70075f5238ecc23ae80baf09af949d4 (diff)
downloadsonarqube-dab939698e737075f7e9467552911a2591f3e846.tar.gz
sonarqube-dab939698e737075f7e9467552911a2591f3e846.zip
SONAR-14586 Add a new uses default credentials flag to api/navigation/global for system administrators
Diffstat (limited to 'sonar-testing-harness')
-rw-r--r--sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java b/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java
index 9438e1c02ec..501a13d8f9f 100644
--- a/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java
+++ b/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java
@@ -94,6 +94,18 @@ public class JsonAssert {
return isSimilarTo(urlToString(expected));
}
+ public JsonAssert isNotSimilarTo(String expected) {
+ boolean similar = comparison.areSimilar(expected, actualJson);
+ if (similar) {
+ throw new ComparisonFailure("It's a super-set of expected JSON -", pretty(expected), pretty(actualJson));
+ }
+ return this;
+ }
+
+ public JsonAssert isNotSimilarTo(URL expected) {
+ return isNotSimilarTo(urlToString(expected));
+ }
+
public static JsonAssert assertJson(String actualJson) {
return new JsonAssert(actualJson);
}