How can i know the reason for build failed, as all my local test cases are passing


i tried looking at my test case files but found nothing
but i couldn’t find any error or any change in my test files.
Is there a way to know the exact reason of test failure.

@Pallav_crio

If you’ve done all the thing correct, please follow these tips, in order to make the online build successfull

Please see whether you’ve followed the stuff written in the milestones or not, like checkout the git branch to check the application UI Interface.

Please redo the stuff and try to shoot all the commands after the specified checkout.

PortfolioManagerFactory to accomodate StockQuoteService as a parameter.

todos:-
mplement the method in such a way that it will return new Instance of
// PortfolioManager
// using RestTemplate and provider name.
// As a first step, Create appropriate instance of StoockQuoteService using
// StockQuoteServiceFactory and then use the same instance of StockQuoteService
// to create the
// instance of PortfolioManager.

the task says to accomodate stockservice as a parameter in portfoliomanagerfactory.
while todos says we have to create an instance of this function .
what is right?

No take it as a parameter and return the instance of portfolioManager.

im getting this error while trying to run ./gradlew built boot

run

Pallav_crio

The problem here is that, you’re taking both resttemplate and stockquoteservice paramters in the single method, that’s why the build is showing you the mismatching parameter exception.

Solution

Try to implement same method as getPortfolioManager(String provider, second argument) two times, one with argument as resttemplate and second one as stockquoteservice.

@Pallav_crio First of all I suggest you delete the screenshot.

Please see there are two arguments which needs to be accepted as a parameter in getPortfolioManager(), Here you’re accepting only one, please read my earlier message, I pointed out that :slight_smile:

i have created two methods in the file.

there are two test cases for the same function one has argument as only resttemplate while the other has arguments as string provider and resttemplate .

2nd function is ok i.e., string provider and resttemplate argument one

in todos it is mentioned as to mark the previous method as deprecated

but still it is showing error for the first function because it is expecting two parameters in there and if i pass another paramenter then the test case which is expecting one parameter shows incorrect

Try to create third method with only one parameter as resttemplate, it needs to work.

i made it but it is showing build failure

I did the same thing, I dont have access to your implemented code, lets see if crio team can resolve this issue.

which one needs to be deprecated

the 3rd method u r talking about is it returning a instance of portfoliomanager with resttemplate and stockquoteservice or just rest template,

and if with stockquoteservice then have u hardcoded the string provider value in it?

you need to deprecate the constructor. As they are saying the previous one, so it should be the one which is accepting a single parameter.

And also what about StockQuoteServiceFactory.java ? May I ask how you implemented it ?

Heyy !!
Ask the following questions to yourself and try to answer them. Most probably you’ll be able to figure out what is wrong.

  1. Have you hard coded anything ?
  2. Have you changed any method signature ?
  3. Have you modified the test files ?

Hey it does not matter if your local cases pass, make sure that you have removed checkstyle/spotbugs/pmd issues in your code and try again?

none in my case
still unable to figure out the reason for assessment failure.

@Pallav_crio can you share the build failed methods screenshot. Not the code, just the errors.

2020-03-12 07:55:48,676 unitTesting INFO Running gradle test
2020-03-12 07:56:08,839 unitTesting INFO Gradle test run complete
2020-03-12 07:56:08,851 unitTesting INFO Build failed

just this coming up

Oh so they’re online compilation errors.

Please see if it works

Take a look in milestones, and see if you hit the following command ./gradlew publishToMavenLocal , I also didnt hit that command, the tests were passing locally but was not online because of this issue.

After that, see if you hit these commands as well:

./gradlew publishToMavenLocal

(and)

git checkout ME_QMONEY_MODULE_ADDITIONAL_REFACTOR

in the specified directories.