VirtualMachineService { public void update(long id, VMInstanceVO vmInstance) { vmInstanceDao.update(id, vmInstance); }  VMInstanceVO searchVmInstanceById(Long vmId); void update(long id, VMInstanceVO vmInstance); void remove(long id);  }
@Test public void updateTest() { VMInstanceVO vm = Mockito.mock(VMInstanceVO.class); Mockito.doReturn(true).when(vmInstanceDao).update(Mockito.anyLong(), Mockito.any(VMInstanceVO.class)); spy.update(0l, vm); Mockito.verify(vmInstanceDao).update(Mockito.anyLong(), Mockito.any(VMInstanceVO.class)); }