3 test cases are failing in assessment

After completing all the codes of module 6 when i am running the command ./gradlew build then all the 21 test cases are passing. but when i am submitting my code for the assessment 3 test cases got failed. I checked the log file but nothing was mentioned there that why i am getting such error. My following test cases are getting failed.

com.crio.warmup.stock.quotes.AlphavantageServiceTest
getStockQuoteSingle()

com.crio.warmup.stock.quotes.AlphavantageServiceTest
getStockQuoteSingleHidden()

com.crio.warmup.stock.quotes.TiingoServiceTest
getStockQuoteSingle()

Someone kindly help. I am not able to figure out why i am getting this error.

There are some hidden test cases at our end to check your logic. Before submitting always try ./gradlew build. if it shows a success message, then you can go for push.

Hey @shrey15 make sure you have implemented the logic for extracting single quote from the list of alphavantage and you have not tried to escape from test cases which are running locally because those functions are checking for logic to extract single Quote from list of candles or you are not following instructions correctly and sort them before returning.

What do you mean by extracting single Quote from list of candles or alphavanatge? How can i check locally ? i ran gradlew build for checking and several other gradlew commands that were mentioned in the todo’s. Is there any other way to check my code locally ?

hi iam facing the same problem, did you solve it ?

Yes. I had to do two changes to get those test cases correct. I am telling you the two instructions that were given in to-do list in alphavantageservicetest.java file that i hadn’t taken care of which caused those errors for me. Make sure you follow these two instructions very carefully.

1)return a sorted List sorted ascending based on Candle#getDate(here also from the list of candles that you are getting extract only those AlphavantageCandle which have date in between the from and to date given in the argument. after doing that sort the list according to the instruction.)

2)Make sure you use {RestTemplate#getForObject(URI, String)} else the test will fail. (here make sure to use the same datatype for arguments as given in the instruction . That is why i have also marked the datatype in bold in which i was doing the mistake.)

I hope it helps.

getForObject(URI, String) ?
shoud’nt it be getForObject(URI, AlphaDailyService.class) ?

but then how will fetch the json data ?

Nope. I did the same mistake. The 2nd argument should be string. See the PortfolioManagerApplication.java there we had to use deserialisation feature. Here you would have to use that after taking the 2nd argument as string. Do it in the same way as we had to do in PortfolioManagerApplication.java

ok will try it out, thanks for reply

ok got it, thanks for help