17 questions
Advice
0
votes
0
replies
49
views
Oauth2 client in spring
Im posting here because cant get a working example of oauth2 client implementation in spring boot 3.5.7
This is my first time ever implementing this type of authentication and cant manage to make it ...
1
vote
0
answers
41
views
Issue with generics in Java extending another class and Spring ParameterizedTypeReference
Using RestTemplate in Spring Boot to connect to a server, I have this generic class to map responses from the server I'm connecting to:
@Data
public class ServicesResponseDTO<T> implements ...
1
vote
2
answers
155
views
Rest Client Integration Tests
I replaced RestTemplate with RestClient and I had some integration tests with the help of MockRestServiceServer from Spring.
MockRestServiceServer is not compatible with RestClient.
The solution is to ...
0
votes
0
answers
87
views
Spring Rest Client read timeout not working as expected with Simple Client Http Factory
I have the code like this:
var fac = new SimpleClientHttpRequestFactory();
fac.setConnectionTimeout(Duration.ofMillis(100))
fac.setReadTimeout(Duration.ofMillis(500))
var restClient = RestClient....
1
vote
0
answers
172
views
Why does setting SimpleClientHttpRequestFactory resolve 404 errors in Spring RestClient?
I am using Spring's Http Interface to make HTTP requests through RestClient. Initially, I created a RestClient instance without setting a requestFactory, as shown below:
@Bean("rest-client-...
3
votes
1
answer
356
views
Spring RestClient - get next pages using pagination Link header
I wonder how I can idiomatically (by using built-in mechanisms in Spring) go through the next pages that are located Link header.
Right now, I need to extract it manually:
private fun ...
2
votes
0
answers
496
views
Migrating RestTemplate code to RestClient code in Spring Boot app
I want to use the Spring Boot's RestClient feature for my application.
So, I want to migrate the existing Spring Boot's RestTemplate code to Spring Boot's RestClient code.
I have a code that works ...
0
votes
1
answer
231
views
Bad Request errors when using Spring RestClient to call AWS S3 predesigned link
I'm trying to make a GET call with the (new) Spring RestClient to an AWS S3 predesigned link.
Example of such link from AWS documentation:
https://examplebucket.s3.us-east-1.amazonaws.com/test.txt ?X-...
2
votes
1
answer
877
views
Unit test Spring's new RestClient exchange() method with code coverage
How can I unit test the exchange() method of Spring's new RestClient with code coverage?
I have a method which fires an http post request to another third party service:
public ResponseEntity<...