diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2021-03-11 14:51:09 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-03-18 20:08:12 +0000 |
commit | dab939698e737075f7e9467552911a2591f3e846 (patch) | |
tree | 823be5eb113a496ad8979de3035b080da9e11e25 /sonar-testing-harness | |
parent | 66249573d70075f5238ecc23ae80baf09af949d4 (diff) | |
download | sonarqube-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.java | 12 |
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); } |