1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ void valueMatches() {
100
100
// Wrong pattern
101
101
assertThatExceptionOfType (AssertionError .class )
102
102
.isThrownBy (() -> assertions .valueMatches ("Content-Type" , ".*ISO-8859-1.*" ))
103
- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage ("Response header " +
103
+ .satisfies (ex -> assertThat (ex ).hasMessage ("Response header " +
104
104
"'Content-Type'=[application/json;charset=UTF-8] does not match " +
105
105
"[.*ISO-8859-1.*]" ));
106
106
}
@@ -117,13 +117,13 @@ void valuesMatch() {
117
117
118
118
assertThatExceptionOfType (AssertionError .class )
119
119
.isThrownBy (() -> assertions .valuesMatch ("foo" , ".*" , "val.*5" ))
120
- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage (
120
+ .satisfies (ex -> assertThat (ex ).hasMessage (
121
121
"Response header 'foo' has fewer or more values [value1, value2, value3] " +
122
122
"than number of patterns to match with [.*, val.*5]" ));
123
123
124
124
assertThatExceptionOfType (AssertionError .class )
125
125
.isThrownBy (() -> assertions .valuesMatch ("foo" , ".*" , "val.*5" , ".*" ))
126
- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage (
126
+ .satisfies (ex -> assertThat (ex ).hasMessage (
127
127
"Response header 'foo'[1]='value2' does not match 'val.*5'" ));
128
128
}
129
129
@@ -158,7 +158,7 @@ void exists() {
158
158
// Header should not exist
159
159
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() ->
160
160
assertions .exists ("Framework" ))
161
- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage ("Response header 'Framework' does not exist" ));
161
+ .satisfies (ex -> assertThat (ex ).hasMessage ("Response header 'Framework' does not exist" ));
162
162
}
163
163
164
164
@ Test
@@ -173,7 +173,7 @@ void doesNotExist() {
173
173
// Existing header
174
174
assertThatExceptionOfType (AssertionError .class ).isThrownBy (() ->
175
175
assertions .doesNotExist ("Content-Type" ))
176
- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage ("Response header " +
176
+ .satisfies (ex -> assertThat (ex ).hasMessage ("Response header " +
177
177
"'Content-Type' exists with value=[application/json;charset=UTF-8]" ));
178
178
}
179
179
@@ -189,7 +189,6 @@ void contentTypeCompatibleWith() {
189
189
// MediaTypes not compatible
190
190
assertThatExceptionOfType (AssertionError .class )
191
191
.isThrownBy (() -> assertions .contentTypeCompatibleWith (MediaType .TEXT_XML ))
192
- .havingCause ()
193
192
.withMessage ("Response header 'Content-Type'=[application/xml] is not compatible with [text/xml]" );
194
193
}
195
194
0 commit comments