Problem in TiingoService.java

In TiingoService.java I copied getStockQuote() funtion buildURI() function from PortfolioManagerImpl. But it results in build failure. Please tell me where I am wrong ?

There are 5 spotbug errors. Please resolve the spotbug errors in your code.

How to fix SpotBugs efficiently

Please check the above FAQ to know more about spotbug issues.

I have not implemented AlphavantageCandle.java yet, that’s why there are unused fields as shown in spotbugs. I just want to check if my TiingoService.java is implemented correctly or not since I am at milestone 1 only.
But, ./gradlew test --tests TiingoServiceTest is showing build failure.

Error : com.fasterxml.jackson.databind.exc.InvalidDefinitionException
Have you seen the above FAQ, please visit this FAQ it might solve your issue.

Still getting the same error.

@Vaishnavi_Singh I suggest you to use String in buildURI() method, its written that you should use URI but it was not working with many of us.

@Vaishnavi_Singh I see that , currently you are facing issues with


com.crio.warmup.stock.quotes.TiingoServiceTest > getStockQuoteSingle() FAILED
com.fasterxml.jackson.databind.exc.InvalidDefinitionException at TiingoServiceTest.java:65

com.crio.warmup.stock.portfolio.PortfolioManagerFactoryTest > getPortfolioManagerWithStockQuoteService() FAILED
org.opentest4j.AssertionFailedError at PortfolioManagerFactoryTest.java:27

com.crio.warmup.stock.portfolio.PortfolioManagerTest > calculateExtrapolatedAnnualizedReturn() FAILED
java.lang.ClassCastException at PortfolioManagerTest.java:106

com.crio.warmup.stock.quotes.AlphavantageServiceTest > getStockQuoteSingle() FAILED
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException at AlphavantageServiceTest.java:65

com.crio.warmup.stock.quotes.StockQuoteServiceFactoryTest > getServiceAlphavantage() FAILED
org.opentest4j.AssertionFailedError at StockQuoteServiceFactoryTest.java:25

com.crio.warmup.stock.quotes.StockQuoteServiceFactoryTest > getServiceDefault() FAILED
org.opentest4j.AssertionFailedError at StockQuoteServiceFactoryTest.java:31

com.crio.warmup.stock.quotes.StockQuoteServiceFactoryTest > getServiceTiingoUpperCase() FAILED
org.opentest4j.AssertionFailedError at StockQuoteServiceFactoryTest.java:19

com.crio.warmup.stock.quotes.StockQuoteServiceFactoryTest > getServiceTiingo() FAILED
org.opentest4j.AssertionFailedError at StockQuoteServiceFactoryTest.java:13


Firstly make sure,

  • you have implemented all the TODO’s in the files properly.
  • you are making the right api call
  • receiving the desired output.
  • handling all the possible conditions.
  • try to run the individual tests and see what is the expected and actual output.

Please refer to the following



https://docs.oracle.com/javase/7/docs/api/java/lang/ClassCastException.html

Closing this topic as there is no response since last 12 hours. Please feel free to create a new topic and post this question as a reference link in the description of the new topic.