+ Start a Discussion

Test an error or exception


I have written one code & in that code 5 files are there,


Bean Class

Service Class

Controller Class

Test Class

Now I am getting 67% of trigger after running test so can u please tell me that which code needs to check if the trigger is less than 75%.

Actually I am getting 100% in Bean Class, But 2% in service class & 88%, 70% in other classes...

So should i check service class or there is no rule like this ?




service class should cover...

Devendra NataniDevendra Natani

You need to write test class for service class.



Devendra Natani

Ankit AroraAnkit Arora

Either write test method for service class or write method which will cover the code of your service class called from your main class.



Ankit Arora