Getting assertion error in tiingo and alphavantage test file at the line:- List<String> propertyKeyValues = urlCaptor.getAllValues();"

What i have tried
convierting string to URI and passing it into getForObject.

i looked around and find only this method.
but this is also not working please suggest solution im stuck on this issue for a whole day

Hey @Pallav_crio, Can you be more specific here. Attach the code snippet.

Ya @Pallav_crio absolutely! You have to get the response from the endpoint using restTemplate in a String object and map it to TiingoCandle[] object using objectMapper class.

Hey @Pallav_crio, I have provided the solution for the same issue here ,have a look How to implement restTemplate.getForObject with String class

I have implemented that but still it isn’t working

Please don’t share screenshot of your code.

HINT for your question -
Could you please check your mapping is correct ?

yes it is correct i cm gettiing desired output in list i checked it using debugger

i will keep that in mind not sharing my code

@Pallav_crio Since you are using URI in the getForObject, let me give you some links from the forum where the discussion was good and useful.


NullPointerException in 2 tests

Mockito is providing a Empty restTemplate

I suggest you follow the above discussion, as the hint and directions are already provided in it.

All the best :slight_smile:

im getting null rsponse in my rst template when i checked it using debugger but all other things things are correct im getting correct output value in candles list

i have tried using getforobject(string,string) too but still it shows assertin fail at mockito

@Pallav_crio, have you gone through the second link provided by me ? They were discussing your pointed error.

yes i have gone through

@Pallav_crio try creating the local Restemplate reference in that function.

i have tried that but still nothing happened

i have tried via both ways via constructor’s ersttemplate and via local created resttemplate

@Pallav_crio I found out one more link, hope it’ll help


TiingoServiceTest Fails when restTemplate is passed and constructor is not used in TiingoService

not working still …
well for noe i 'll give it a break i have tried countless methods tillnow :sleepy:

:smile: Ok, sometimes fresh mind works like a miracle :sweat_smile:

Thats why surely take a break.

Hey @Pallav_crio , I think your issue is resolved. I’m closing this ticket. If any of the above reply has helped you find the solution for your issue please mark that reply as a solution. If your issue is still not resolved please feel free to create a new topic and add this topic’s link in the description.

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, please feel free to create a new topic and post this question as a reference link in the description of the new topic.