java - Mockito return false -
i write simple test on mokito. public class contactservicetest { @mock private serviceclient client; @mock private contactservice contactservice; @before public void init() { client = mock(serviceclient.class); contactservice = mock(contactservice.class); } @test public void test_sendemailcontact() { contactdto cdto = new contactdto(); cdto.settitle("mr"); cdto.setfirstname("pritam"); cdto.setlastname("mohapatra"); cdto.settelephone("9439586575"); cdto.setemail("pritam.pritam176@gmail.com"); cdto.setbetreff("test value"); cdto.setanfrage("test value"); when(client.posttoservice("customer/sendemailcontact", cdto, boolean.class)).thenreturn(true); assert.assertequals(true, contactservice.sendemailcontact(cdto)); } } but when fail msg expected true return false m