-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement
Milestone
Description
Phillip Wirth opened SPR-14278 and commented
The Warning: Unchecked generics Array Creation for varags parameter in .andExpect(header("X-ClientVersion", equalTo("warnings_occurs_here"))) does not seem to be necessary.
Complete test method code:
@Test
public void testSomeMethod() {
this.mockServer.expect(requestTo("http://somthing"))
.andExpect(method(HttpMethod.POST))
.andExpect(header("X-ClientName", "gotcha"))
.andExpect(header("X-ClientVersion", equalTo("warnings_occurs_here")))
.andExpect(content().string(isEmptyOrNullString()))
.andRespond(withSuccess());
this.someClient.someMethod(666, 888);
this.mockServer.verify();
}I guess when @SafeVarargs would be applied to MockRestRequestMatchers#header everything would be fine.
@SafeVarargs exists since Java 7.
Spring Tests do have a targetCompatiblity to 1.8 so this should work too. (If I interpreted that correctly from settings.gradle.)
Affects: 4.3 RC2
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement