Skip to content

Commit

Permalink
Upgrade AssertJ
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-krecan committed Jun 17, 2021
1 parent 7411f0c commit e39c67e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ internal class KotlinDslTest {
}
}.hasMessage("[Different value found in node \"result.string\"] \n" +
"expected: \"stringValue2\"\n" +
"but was : \"stringValue\"")
" but was: \"stringValue\"")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal class KotlinWebTestClientTest {
}
}.hasMessage("[Different value found in node \"result.string\"] \n" +
"expected: \"stringValue2\"\n" +
"but was : \"stringValue\"")
" but was: \"stringValue\"")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void containsAnyOfShouldFailWithMatcher() {
entry("b", json("\"${json-unit.any-string}\""))
)
).hasMessage("[Different value found in node \"\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"a\":1,\"b\":2}\n" +
"to contain at least one of the following elements:\n" +
" [MapEntry[key=\"a\", value=\"${json-unit.any-string}\"],\n" +
Expand All @@ -210,7 +210,7 @@ void containsValuesShouldFail() {
assertThatThrownBy(() ->
assertThatJson(json).isObject().containsValues(valueOf(1), valueOf(2), json("\"${json-unit.any-string}\""))
).hasMessage("[Different value found in node \"\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"a\":1,\"b\":2}\n" +
"to contain value:\n" +
" \"${json-unit.any-string}\"");
Expand Down Expand Up @@ -247,7 +247,7 @@ void objectShouldContainComplexValueError() {
.isObject()
.containsValue(json("{\"c\" :5}")))
.hasMessage("[Different value found in node \"root\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"a\":1,\"b\":{\"c\":3}}\n" +
"to contain value:\n" +
" {\"c\":5}");
Expand All @@ -266,7 +266,7 @@ void objectDoesContainComplexValueError() {
.isObject()
.doesNotContainValue(json("{\"c\" :3}")))
.hasMessage("[Different value found in node \"root\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"a\":1,\"b\":{\"c\":3}}\n" +
"not to contain value:\n" +
" {\"c\":3}");
Expand Down Expand Up @@ -295,7 +295,7 @@ void compareJsonInJsonPathShallowArrayString() {
.isArray()
.containsExactly(value("450")))
.hasMessage("[Different value found in node \"$.root\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" [450]\n" +
"to contain exactly (and in same order):\n" +
" [\"450\"]\n" +
Expand Down Expand Up @@ -433,7 +433,7 @@ void shouldAssertContainsOnlyKeys() {
void shouldAssertContainsOnlyKeysError() {
assertThatThrownBy(() -> assertThatJson("{\"a\":{\"b\": 1, \"c\": true}}").node("a").isObject().containsOnlyKeys("b", "c", "d"))
.hasMessage("[Different value found in node \"a\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"b\":1,\"c\":true}\n" +
"to contain only following keys:\n" +
" [\"b\", \"c\", \"d\"]\n" +
Expand Down Expand Up @@ -479,7 +479,7 @@ void shouldAssertObjectIsNotEqualToJsonWithPlaceholder() {
void shouldAssertObjectIsNotEqualToJsonWithPlaceholderError() {
assertThatThrownBy(() -> assertThatJson("{\"a\":{\"b\": \"string\"}}").node("a").isObject().isNotEqualTo(json("{\"b\":\"${json-unit.any-string}\"}")))
.hasMessage("[Different value found in node \"a\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"b\":\"string\"}\n" +
"not to be equal to:\n" +
" {\"b\":\"${json-unit.any-string}\"}\n" +
Expand All @@ -497,7 +497,7 @@ void shouldAssertObjectJsonWithPlaceholderFailure() {
void shouldAssertString() {
assertThatThrownBy(() -> assertThatJson("{\"a\":{\"b\": \"foo\"}}").node("a.b").isString().startsWith("bar"))
.hasMessage("[Different value found in node \"a.b\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" \"foo\"\n" +
"to start with:\n" +
" \"bar\"\n");
Expand All @@ -507,7 +507,7 @@ void shouldAssertString() {
void shouldAssertStringCustomDescription() {
assertThatThrownBy(() -> assertThatJson("{\"a\":{\"b\": \"foo\"}}").node("a.b").isString().as("Sad!").startsWith("bar"))
.hasMessage("[Sad!] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" \"foo\"\n" +
"to start with:\n" +
" \"bar\"\n");
Expand Down Expand Up @@ -636,7 +636,7 @@ void shouldAssertNotNullChaining() {
assertThatThrownBy(() -> assertThatJson("{\"a\":{\"b\": 1}}").node("a").isNotNull().node("b").isNumber().isEqualByComparingTo("2"))
.hasMessage("[Different value found in node \"a.b\"] \n" +
"expected: 2\n" +
"but was : 1");
" but was: 1");
}

@Test
Expand Down Expand Up @@ -783,7 +783,7 @@ void containsValue() {
assertThatThrownBy(() -> assertThatJson("{\"a\": 1}")
.isObject().containsKey("lastModified2"))
.hasMessage("[Different value found in node \"\"] \n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"a\":1}\n" +
"to contain key:\n" +
" \"lastModified2\"");
Expand All @@ -805,7 +805,7 @@ void shouldAssertNumberFailure() {
assertThatThrownBy(() -> assertThatJson("{\"a\":1}").node("a").isNumber().isEqualByComparingTo("2"))
.hasMessage("[Different value found in node \"a\"] \n" +
"expected: 2\n" +
"but was : 1");
" but was: 1");
}


Expand Down Expand Up @@ -861,7 +861,7 @@ void testPresentWithDescription() {
protected void testNotEqualTo() {
assertThatThrownBy(() -> assertThatJson("{\"test\":1}").isNotEqualTo("{\"test\": \"${json-unit.any-number}\"}"))
.hasMessage("\n" +
"Expecting:\n" +
"Expecting actual:\n" +
" {\"test\":1}\n" +
"not to be equal to:\n" +
" \"{\"test\": \"${json-unit.any-number}\"}\"\n" +
Expand Down Expand Up @@ -1195,7 +1195,7 @@ void positiveArrayIndexOutOfBounds() {
void arrayThatContainsShouldFailOnMissingNode() {
assertThatThrownBy(() -> assertThatJson("{\"test\":[{\"id\":36},{\"id\":37},{\"id\":38}]}").node("test").isArray().contains("{\"id\":42}"))
.hasMessage("[Different value found in node \"test\"] \n" +
"Expecting ArrayList:\n" +
"Expecting JsonList:\n" +
" [{\"id\":36}, {\"id\":37}, {\"id\":38}]\n" +
"to contain:\n" +
" [\"{\"id\":42}\"]\n" +
Expand Down Expand Up @@ -1576,7 +1576,7 @@ protected void jsonPathShouldBeAbleToUseArrays() {
" }"
)))
.hasMessage("[Different value found in node \"$.store.book\"] \n" +
"Expecting ArrayList:\n" +
"Expecting JsonList:\n" +
" [{\"author\":\"Nigel Rees\",\"category\":\"reference\",\"price\":8.95,\"title\":\"Sayings of the Century\"},\n" +
" {\"author\":\"Evelyn Waugh\",\"category\":\"fiction\",\"price\":12.99,\"title\":\"Sword of Honour\"},\n" +
" {\"author\":\"Herman Melville\",\"category\":\"fiction\",\"isbn\":\"0-553-21311-3\",\"price\":8.99,\"title\":\"Moby Dick\"},\n" +
Expand Down

0 comments on commit e39c67e

Please sign in to comment.