Module 4 exception during gradlew

when i am running the gradlew command given in todo
i am getting this error

Task :qmoney:run
Feb 27, 2020 3:33:32 PM com.crio.warmup.stock.PortfolioManagerApplication printJsonObject
INFO: [“AAPL”,“MSFT”,“GOOGL”]
Feb 27, 2020 3:33:34 PM com.crio.warmup.stock.PortfolioManagerApplication printJsonObject
INFO: [“MSFT”,“AAPL”,“GOOGL”]
Feb 27, 2020 3:33:35 PM com.crio.warmup.stock.PortfolioManagerApplication printJsonObject
INFO: [{“symbol”:“AAPL”,“annualizedReturn”:0.8991961902574852,“totalReturns”:0.8958615791852282},{“symbol”:“MSFT”,“annualizedReturn”:0.5861319149925
504,“totalReturns”:0.5841285786037167},{“symbol”:“GOOGL”,“annualizedReturn”:0.30487427079219565,“totalReturns”:0.3039232866043614}]
15:33:35.366 [main] ERROR com.crio.warmup.stock.log.UncaughtExceptionHandler - {“stacktrace”:[“java.net.URI.create(URI.java:852)”,“org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.createUri(DefaultUriBuilderFactory.java:400)”,“org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.build(DefaultUriBuilderFactory.java:393)”,“org.springframework.web.util.DefaultUriBuilderFactory.expand(DefaultUriBuilderFactory.java:205)”,“org.springframework.web.client.RestTemplate.execute(RestTemplate.java:676)”,“org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:318)”,“com.crio.warmup.stock.portfolio.PortfolioManagerImpl.getStockQuote(PortfolioManagerImpl.java:123)”,“com.crio.warmup.stock.portfolio.PortfolioManagerImpl.calculateAnnualizedReturn(PortfolioManagerImpl.java:73)”,“com.crio.warmup.stock.PortfolioManagerApplication.mainCalculateReturnsAfterRefactor(PortfolioManagerApplication.java:290)”,“com.crio.warmup.stock.PortfolioManagerApplication.main(PortfolioManagerApplication.java:315)”],“cause”:“java.lang.IllegalArgumentException: Expected scheme-specific part at index 6: https:”}
java.lang.IllegalArgumentException: Expected scheme-specific part at index 6: https:
at java.net.URI.create(URI.java:852) ~[?:1.8.0_242]
at org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.createUri(DefaultUriBuilderFactory.java:400) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.build(DefaultUriBuilderFactory.java:393) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.util.DefaultUriBuilderFactory.expand(DefaultUriBuilderFactory.java:205) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:676) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:318) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at com.crio.warmup.stock.portfolio.PortfolioManagerImpl.getStockQuote(PortfolioManagerImpl.java:123) ~[main/:?]
at com.crio.warmup.stock.portfolio.PortfolioManagerImpl.calculateAnnualizedReturn(PortfolioManagerImpl.java:73) ~[main/:?]
at com.crio.warmup.stock.PortfolioManagerApplication.mainCalculateReturnsAfterRefactor(PortfolioManagerApplication.java:290) ~[main/:?]
at com.crio.warmup.stock.PortfolioManagerApplication.main(PortfolioManagerApplication.java:315) ~[main/:?]
Caused by: java.net.URISyntaxException: Expected scheme-specific part at index 6: https:
at java.net.URI$Parser.fail(URI.java:2848) ~[?:1.8.0_242]
at java.net.URI$Parser.failExpecting(URI.java:2854) ~[?:1.8.0_242]
at java.net.URI$Parser.parse(URI.java:3057) ~[?:1.8.0_242]
at java.net.URI.(URI.java:588) ~[?:1.8.0_242]
at java.net.URI.create(URI.java:850) ~[?:1.8.0_242]
… 9 more

please someone help i am stuck at this error

not able to proceed

make sure your url for api calls are correct (Hint: it should start with https://)

I guess it has something to do with your uri. Do one thing, add a break point after generating your uri and print it’s value on debug console. That’ll help you find out if it’s correct or not.

debug tests are all passing

but when i run gradlew coomand it shows tis error

all tests will pass because no api calls are made during testing they are just mocking it

Check your uri. Make sure it’s https.

what is uri
couldnot get you

The string you are making fir the api call.

thanks for your reply

i thought the string template given in the todo is coorect so i didn’t bother to have a look at it

it was using https:api/tingo/…

but it should have been https://api/tiingo

thanks