Java compile error in unit testing module 2

Error: Task qmoney:compileTestJava failed!

I have no idea why i am getting this error although all tests ran fine when i did ./gradlew build.
Here is what i have tried repeatedly:-
1.resetting the workspace
2. ./gradlew clean build
Also it the editor was saying something about setting executable maven executbale path,so i think it might be related to this.

Again, all local test cases work fine.

Any help will be greatly appreciated.

Perhaps a stacktrace could help pinpoint the error better.

Unfortunately,there is no stack trace in the logs for unit testing.
Just this
2020-02-21 19:28:36,494 unitTesting INFO Running gradle test
2020-02-21 19:28:52,880 unitTesting INFO Gradle test run complete
2020-02-21 19:28:52,891 unitTesting INFO Build failed

I just checked your code, you have to use POJO files and parse your JSON through that POJO files. These POJO files are already givrn in dto folder. Please look into it. You just have to write code in mainReadQuotes method. Please strictly follow the TODOs given in the PortfolioManagerApplication.java file.

@Saurav_Crio.Do
The PortfolioTrade class does not have setter(default accepts a localdate object) for date which accepts a string so jackson is not able to assign value to objects.
Does this mean i have to modify or create my own setter which accepts a string as input.

The error
Cannot construct instance of java.time.LocalDate (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value (‘2019-01-02’)

Why not use local date, you need to only convert it into string when trying to use dates in the url link.

@Saurav_Crio.Do
But when reading JSON from file,it is reading date as string and it is unable to cast to LocalDate object on its own,until i provide LocalDate.parse(String) method.Which is what is causing the above error.

And even after using default classes it is showing
Task qmoney:compileTestJava failed!

I am also facing this error Please help @Saurav_Crio.Do sir.

Have your problem solved @Swapnil97 ?

Solved !!! make sure your makereadfile() function exist in the Portfolioapplication class.

1 Like

i think i deleted it.
from where do i get the function @Sumit-kushwah ?

use git reset “commit head” command to get previous code

Dude you’re a savior ! Thanks a ton! How did you even figure out that mainreadfile() was the issue?