spring-projects / spring-security-samples

1.4k stars 685 forks source link

Fix jackson issue on HelloSecurityExplicitITests #232

Closed canattofilipe closed 3 months ago

marcusdacoregio commented 3 months ago

Hi @canattofilipe, what is the issue?

canattofilipe commented 3 months ago

Hi @marcusdacoregio This PR solve the same issue described here -> https://github.com/spring-projects/spring-security-samples/pull/223#issue-2204105202

org.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [class example.CustomUser] and content type [application/json]

    at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:124)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:892)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:790)
    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:404)
    at org.springframework.boot.test.web.client.TestRestTemplate.getForObject(TestRestTemplate.java:199)
    at example.HelloSecurityExplicitITests.login(HelloSecurityExplicitITests.java:41)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
marcusdacoregio commented 3 months ago

Thanks, I missed your comment