Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String testDocumentJson =
- this.restTemplate.postForObject(url, data, String.class);
- ObjectMapper mapper = new ObjectMapper();
- PageImpl<TestDocument> resultPage =
- mapper.readValue(testDocumentJson,
- new TypeReference<TestResponse<TestDocument>>() {});
- ResponseEntity<TestResponse<TestDocument>> TestDocImplPageResponse =
- this.restTemplate.exchange(url, HttpMethod.POST, requestEntity,
- new ParameterizedTypeReference<TestResponse<TestDocument>>() {});
- org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [com.TestResponse<com.model.TestDoc>] and content type [application/json;charset=UTF-8]
- public class TestResponse<T> extends PageImpl<T> {
- private int number;
- private int size;
- private int totalPages;
- private int numberOfElements;
- private long totalElements;
- private boolean previousPage;
- private boolean first;
- private boolean nextPage;
- private boolean last;
- private List<T> content;
- private Sort sort;
- public TestResponse() {
- super(new ArrayList<T>());
- }
- getters and setters
- }
- public class TestDocument
- {
- private String name
- ...
- fields and getters and setters
- }
Add Comment
Please, Sign In to add comment