11/*
2- * Copyright 2002-2020 the original author or authors.
2+ * Copyright 2002-2021 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ void valueMatches() {
100100 // Wrong pattern
101101 assertThatExceptionOfType (AssertionError .class )
102102 .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 " +
104104 "'Content-Type'=[application/json;charset=UTF-8] does not match " +
105105 "[.*ISO-8859-1.*]" ));
106106 }
@@ -117,13 +117,13 @@ void valuesMatch() {
117117
118118 assertThatExceptionOfType (AssertionError .class )
119119 .isThrownBy (() -> assertions .valuesMatch ("foo" , ".*" , "val.*5" ))
120- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage (
120+ .satisfies (ex -> assertThat (ex ).hasMessage (
121121 "Response header 'foo' has fewer or more values [value1, value2, value3] " +
122122 "than number of patterns to match with [.*, val.*5]" ));
123123
124124 assertThatExceptionOfType (AssertionError .class )
125125 .isThrownBy (() -> assertions .valuesMatch ("foo" , ".*" , "val.*5" , ".*" ))
126- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage (
126+ .satisfies (ex -> assertThat (ex ).hasMessage (
127127 "Response header 'foo'[1]='value2' does not match 'val.*5'" ));
128128 }
129129
@@ -158,7 +158,7 @@ void exists() {
158158 // Header should not exist
159159 assertThatExceptionOfType (AssertionError .class ).isThrownBy (() ->
160160 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" ));
162162 }
163163
164164 @ Test
@@ -173,7 +173,7 @@ void doesNotExist() {
173173 // Existing header
174174 assertThatExceptionOfType (AssertionError .class ).isThrownBy (() ->
175175 assertions .doesNotExist ("Content-Type" ))
176- .satisfies (ex -> assertThat (ex . getCause () ).hasMessage ("Response header " +
176+ .satisfies (ex -> assertThat (ex ).hasMessage ("Response header " +
177177 "'Content-Type' exists with value=[application/json;charset=UTF-8]" ));
178178 }
179179
@@ -189,7 +189,6 @@ void contentTypeCompatibleWith() {
189189 // MediaTypes not compatible
190190 assertThatExceptionOfType (AssertionError .class )
191191 .isThrownBy (() -> assertions .contentTypeCompatibleWith (MediaType .TEXT_XML ))
192- .havingCause ()
193192 .withMessage ("Response header 'Content-Type'=[application/xml] is not compatible with [text/xml]" );
194193 }
195194
0 commit comments