.expectBody(String.class).isEqualTo("bar");
verify(service).getRemoteText("foo");
}
+
+ @DisplayName("Mappings for RestController without a parameter")
+ @ParameterizedTest(name = "{arguments} ==> uri={0}")
+ @ValueSource(strings = { "/", "", "?foo=bar", "/?foo=bar"})
+ void testUriWithoutParameter(String uri)
+ {
+ webClient
+ .get()
+ .uri(uri)
+ .header("Accept", MediaType.TEXT_PLAIN_VALUE)
+ .exchange()
+ .expectStatus().isBadRequest()
+ .expectBody()
+ .jsonPath("status").isEqualTo(400)
+ .jsonPath("error").isEqualTo("Bad Request")
+ .jsonPath("message").isEqualTo("Required String parameter 'path' is not present")
+ .jsonPath("timestamp").exists();
+ }
}