Exemplo n.º 1
0
  @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);
  }
Exemplo n.º 2
0
  /** @return Employee Add Clients */
  public String addClients() {

    xyz.addClients(adds);
    return SUCCESS;
  }