@Test public void testCreate() throws Exception { Department p1 = new Department.Builder(0201).name("D-O-D").build(); Department returnDepartment = crudService.persist(p1); when(crudService.persist(p1)).thenReturn(returnDepartment); Mockito.verify(crudService).persist(p1); }