Error in module 6 , AssertionFailedError: expected: <true> but was: <false>

getting this error, in module 6 in com.crio.warmup.stock.quotes.AlphavantageServiceTest

AssertionFailedError: expected: <true> but was: <false>

I have done some debugging and I think the problem is with argumentcaptor , seems like captor is not capturing , but I am not able to understand why it is not capturing and why this Test fails

In your stack trace it shows that in AlphavantageServiceTest.getStockQuoteSingle at line 87 the assert statement returns false instead of true
I would suggest to put break point in AlphavantageServiceTest and in AlphavantageService in getStock… and then check line by line for the output what is causing your assert statement fails

I have done that already , the reason is propertyKeyValues, propertyKeyValues2, propertyKeyValues3 are empty because captor didn’t capture anything. and that I am not able to understand

Just a wild guess Instead of creating new restTemplate
use your local restTemplate

I don’t think AlphavantageService class has local restTemplate , since it implements the StockQuotesService and also there is not constructor available as far as I know.

read the todo of stockQuoteServiceFactory you will understand

ohh , I my mistake , I was not passing restTemplate from Factory

thank you

1 Like

Closing this topic as your issue has been resolved by the community.