@Test public final void test_save() { Function expextedResult = getFunctions().get(0); when(functionRepository.save(any(Function.class))).thenReturn(expextedResult); Function actualResult = functionService.save(getFunctions().get(0)); assertEquals(expextedResult, actualResult); }
@Transactional public Function save(Function function) { return functionRepository.save(function); }
FunctionService { @Transactional public Function save(Function function) { return functionRepository.save(function); } }
FunctionService { @Transactional public Function save(Function function) { return functionRepository.save(function); }  }
FunctionService { @Transactional public Function save(Function function) { return functionRepository.save(function); }  @Transactional List<Function> create(List<Function> functions, BindingResult errors, RequestInfo requestInfo); @Transactional List<Function> update(List<Function> functions, BindingResult errors, RequestInfo requestInfo); List<Function> fetchRelated(List<Function> functions); Pagination<Function> search(FunctionSearch functionSearch, BindingResult errors); @Transactional Function save(Function function); @Transactional Function update(Function function); }
FunctionService { @Transactional public Function save(Function function) { return functionRepository.save(function); }  @Transactional List<Function> create(List<Function> functions, BindingResult errors, RequestInfo requestInfo); @Transactional List<Function> update(List<Function> functions, BindingResult errors, RequestInfo requestInfo); List<Function> fetchRelated(List<Function> functions); Pagination<Function> search(FunctionSearch functionSearch, BindingResult errors); @Transactional Function save(Function function); @Transactional Function update(Function function);  }