Код: Выделить всё
org.springframework.web.client.ResourceAccessException: I/O error on PATCH request for "http://localhost:8080/people/1":Invalid HTTP method: PATCH; nested exception is java.net.ProtocolException: Invalid HTTP method: PATCH
< /code>
Я делаю что -то похожее на принятый ответ: < /p>
@Configuration
class TestRestTemplateConfig {
@Bean
fun testRestTemplate(restTemplateBuilder: RestTemplateBuilder): TestRestTemplate {
val testRestTemplate = TestRestTemplate(restTemplateBuilder, null, null, null)
testRestTemplate.restTemplate.requestFactory = HttpComponentsClientHttpRequestFactory()
return testRestTemplate
}
}
< /code>
Также у меня есть зависимость: < /p>
implementation("org.apache.httpcomponents:httpclient:4.5.14")
< /code>
Но когда я начинаю тест, я вижу ошибку: < /p>
Caused by: java.lang.ClassNotFoundException: org.apache.hc.client5.http.classic.HttpClient
Я пытался выполнить Commandl Gradle "/>
. Я в замешательстве.
Подробнее здесь: https://stackoverflow.com/questions/767 ... tp-classic