-
Couldn't load subscription status.
- Fork 38.8k
Closed as duplicate
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issuetheme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin support
Description
In ContentResultMatchersDsl, the functions that accept a Matcher don't allow matchers for supertypes of the checked type. This causes code like
mockMvc
.get("/books/{bookId}/blurb", BOOK_ID)
.andExpect { status { isOk() } }
.andExpect { content { string(hasLength(145)) } }
to not compile, since hasLength is a Matcher<CharSequence> and string wants a Matcher<String>. The original method does accept a Matcher<? super String>; in this case, changing the string method to accept a Matcher<in String> would also solve this compilation error.
The other functions that accept a matcher (node and source) exhibit the same problem.
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issuetheme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin support