Help out with an error in module 2 milestone 3

Task :qmoney:test

com.crio.warmup.stock.ModuleTwoTest > mainReadQuotesInvalidDates() FAILED
org.opentest4j.AssertionFailedError at ModuleTwoTest.java:44

TEST RESULT: FAILURE
TEST SUMMARY: RAN 8 TESTS, 7 SUCCEEDED, 1 FAILED, 0 SKIPPED

8 tests completed, 1 failed

Task :qmoney:test FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:qmoney:test’.

There were failing tests. See the report at: file:///home/crio-user/workspace/adityabharadwaj198-ME_QMONEY/qmoney/build/reports/tests/test/index.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/5.2.1/userguide/command_line_interface.html#sec:command_line_warnings

I’ve even tried going through the testing function, but couldn’t understand much. Can anyone help please.

Hi, @adityab

As you would already know, it’s saying that the test called mainReadQuotesInvalidDates() in com.crio.warmup.stock.ModuleTwoTest is failling.

You can find out why by going to the code of this test and seeing its contents.
Hint: Check the purchasing dates of all the stocks in the JSON file we give as input and then see if there’s any problem with the end date we are providing in comparison to the purchase date

Let me know if it helped :slightly_smiling_face:

Keep in mind, you could never find price of a stock if the stocks were not even purchased

The api will not return if the above scenario occurs

It wasn’t that but thanks for the help anyway.

is your api request successful?
check that in debugging. I once got a similar error when i wrote my token wrong

You’ll need to add some code for handling the invalid dates and throwing a runtime exception for the same.