Calculate Annualized Return NoDataOnEndDate() testcase fail

calculateAnnualizedReturnNoDataOnEndDate()

Only this testcase is failing. If endDate is null, I’m using the latest date using LocalDate.now() else I’m proceeding with the given endDate itself.

Yet the assessment still fails. Any idea?

@sashi_Crio.Do @Rahul-Crio.do @anand-crio

Please refer to the following FAQ


Also please make sure you don’t hard code any values.
And LocalDate.now() fetches the current date, it is not that which you want.

Then what do we have to fetch for the latest date
Is it not LocalDate.now()

While calling the Tiingo API, there could be a case where the might not be an End-Date provided
In that case, you need to extract data for the latest date .

For example, you make an API call by providing the start date and the end date.
ex: start date = 02-02-2019 and end date = 02-09-2019.
And after receiving the API response, you may not have data related to 02-09-2019 in your responses, but you may have data on 01-09-2019. Then you have to take the data on 01-09-2019, as it is the latest date for which the data is available.

Okay, got it. Thank you

Can you check my function? I have tried my best to implement this. I’m stuck.

I have made a Dm to you. Please check.

I am also stuck on this testcase failure. Has anyone got the solution?

I have taken care of this condition :-
And after receiving the API response, you may not have data related to 02-09-2019 in your responses, but you may have data on 01-09-2019. Then you have to take the data on 01-09-2019, as it is the latest date for which the data is available.

Is there any case where we are not providing args[1] ?

Yes @iamanuragbansal I think there is a case in which they don’t provide the second argument.
Have tried removing endDate from the URL but keeping the startDate. Try that in postman.