@Test public void testEmp_AddClients() throws Exception { Client_Login clientLogdet = new Client_Login(); Emp_AddClient_DaoImpl mocknew = PowerMockito.mock(Emp_AddClient_DaoImpl.class); PowerMockito.whenNew(Emp_AddClient_DaoImpl.class).withNoArguments().thenReturn(mocknew); Client_Login mockCleintLogDet = PowerMockito.mock(Client_Login.class); PowerMockito.when(mocknew.addClients(mockCleintLogDet)).thenReturn(clientLogdet); String addEmp = new Emp_AddClient_Action().addClients(); Assert.assertEquals(addEmp, "success"); PowerMockito.verifyNew(Emp_AddClient_DaoImpl.class); }
/** @return Employee Add Clients */ public String addClients() { xyz.addClients(adds); return SUCCESS; }