Hello everyone,I have a question with the coverage tests and the use of 
Mokito object 

In my test <http://www.javaranch.com/unit-testing.jsp> class 

@Test 
public String 
<http://www.coderanch.com/t/410859/java/java/string-stringbuffer-stringbuilder-performance>
 savePessoaWithErro(){ 
when(result.hasErrors()).thenReturn(true); 
String returnSavePessoa= appController.savePessoa(any(Pessoa.class), 
result, model); 
/* when appController.savePessoa(any(Pessoa.class), result, model) , and 
result.hasErrors()=true, appController return pessoaadd */ 
AssertJUnit.assertEquals(returnSavePessoa,"pessoaadd"); 
return anyString(); 


} 

In my controller class 
@RequestMapping(value = { "/newpessoa" }, method = RequestMethod.POST) 
public String savePessoa(@Valid Pessoa pessoa, BindingResult result, 
ModelMap model) { 

if (result.hasErrors()) { 
return PESSOAADD; 
} 



model.addAttribute(SUCCESS, pessoaService.save(pessoa)); 

return "pessoaRegistrationsuccess"; 
} 


But jacoco,mark this as not covered and do not understand the reason. 
someone would know the reason? 
I appreciate your help and time 
Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/450d2a53-e5e1-41ad-b2c1-e6d468ee118a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to