Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Related questions check this answerthis answer as is related to the case you are encountering.

Testing connectTimeout you can refer to this answerthis answer of various ways of having an endpoint that prevents a socket connection from completing thus obtaining a timeout. Choosing a solution, you can create an integration test in spring-boot which validates your implementation. This can be similar to the next test used for testing the readTimeout, just that for this case the URL can be changed into one that prevents a socket connection.

Related questions check this answer as is related to the case you are encountering.

Testing connectTimeout you can refer to this answer of various ways of having an endpoint that prevents a socket connection from completing thus obtaining a timeout. Choosing a solution, you can create an integration test in spring-boot which validates your implementation. This can be similar to the next test used for testing the readTimeout, just that for this case the URL can be changed into one that prevents a socket connection.

Related questions check this answer as is related to the case you are encountering.

Testing connectTimeout you can refer to this answer of various ways of having an endpoint that prevents a socket connection from completing thus obtaining a timeout. Choosing a solution, you can create an integration test in spring-boot which validates your implementation. This can be similar to the next test used for testing the readTimeout, just that for this case the URL can be changed into one that prevents a socket connection.

added 240 characters in body
Source Link
andreim
  • 3.5k
  • 27
  • 22

Why not mocking using MockRestServiceServer with a RestTemplate, replaces the request factory. Therefore any RestTemplate settings will be replaced. Therefore using a real app for timeout testing might be the only option here.

Note: check also this article about RestTemplate configuration which include also the timeout configuration.

Note: check also this article about RestTemplate configuration which include also the timeout configuration.

Why not mocking using MockRestServiceServer with a RestTemplate, replaces the request factory. Therefore any RestTemplate settings will be replaced. Therefore using a real app for timeout testing might be the only option here.

Note: check also this article about RestTemplate configuration which include also the timeout configuration.

added 3 characters in body
Source Link
andreim
  • 3.5k
  • 27
  • 22

Testing connectTimeout you can refer to this answer of various ways of having an endpoint that prevents a socket connection from completing thus obtaining a timeout. Choosing a solution, you can create an integration test in spring-boot which validates your implementation. This can be similar to the next test used for testing the readTimeout, just that for this case the URL can be changed into one that prevents a socket connection.

Testing connectTimeout you can refer to this answer of various ways of having an endpoint that prevents a socket connection from completing thus obtaining a timeout. Choosing a solution, you can create an integration test in spring-boot which validates your implementation. This can be similar to the next test used for testing the readTimeout, just that for this case the URL can changed into one that prevents a socket connection.

Testing connectTimeout you can refer to this answer of various ways of having an endpoint that prevents a socket connection from completing thus obtaining a timeout. Choosing a solution, you can create an integration test in spring-boot which validates your implementation. This can be similar to the next test used for testing the readTimeout, just that for this case the URL can be changed into one that prevents a socket connection.

Source Link
andreim
  • 3.5k
  • 27
  • 22
Loading