DepartmentService { @Transactional public void createDepartment(final Department department) { departmentRepository.save(department); } @Autowired  DepartmentService(final DepartmentRepository departmentRepository); @Transactional void createDepartment(final Department department); @Transactional void updateDepartment(final Department department); Department getDepartmentById(final Long id); Department getDepartmentByName(final String name); List<Department> getAllDepartments(); Department getDepartmentByCode(final String code); List<Department> getAllDepartmentsByNameLike(final String name); List<Department> getDepartmentsByNames(List<String> names); @Transactional void deleteDepartment(final Department department);  }
@Test public void shouldCreateDepartment() { departmentService.createDepartment(department); verify(departmentRepository).save(department); }