@Test public void shouldUpdateRole() { role.setRights(asList(new Right(CREATE_REQUISITION, ADMIN))); roleRightsService.updateRole(role); verify(roleRightsRepository).updateRole(role); }
public void updateRole(Role role) { roleRightsRepository.updateRole(role); }
RoleRightsService { public void updateRole(Role role) { roleRightsRepository.updateRole(role); } }
RoleRightsService { public void updateRole(Role role) { roleRightsRepository.updateRole(role); } @Autowired  RoleRightsService(RoleRightsRepository roleRightsRepository,
                           SupervisoryNodeService supervisoryNodeService,
                           FacilityService facilityService,
                           ProgramService programService,
                           ProgramProductService programProductService); }
RoleRightsService { public void updateRole(Role role) { roleRightsRepository.updateRole(role); } @Autowired  RoleRightsService(RoleRightsRepository roleRightsRepository,
                           SupervisoryNodeService supervisoryNodeService,
                           FacilityService facilityService,
                           ProgramService programService,
                           ProgramProductService programProductService); @Transactional void saveRole(Role role); Map<String, List<Role>> getAllRolesMap(); Role getRole(Long id); List<Role> getAllRoles(); void updateRole(Role role); List<Right> getRights(Long userId); List<Right> getRightsForUserAndFacilityProgram(Long userId, Facility facility, Program program); List<Right> getRightsForUserAndWarehouse(Long userId, Long warehouseId); List<Right> getRightsForUserFacilityAndProductCode(Long userId, Long facilityId, String productCode); RightType getRightTypeForRoleId(Long roleId); }
RoleRightsService { public void updateRole(Role role) { roleRightsRepository.updateRole(role); } @Autowired  RoleRightsService(RoleRightsRepository roleRightsRepository,
                           SupervisoryNodeService supervisoryNodeService,
                           FacilityService facilityService,
                           ProgramService programService,
                           ProgramProductService programProductService); @Transactional void saveRole(Role role); Map<String, List<Role>> getAllRolesMap(); Role getRole(Long id); List<Role> getAllRoles(); void updateRole(Role role); List<Right> getRights(Long userId); List<Right> getRightsForUserAndFacilityProgram(Long userId, Facility facility, Program program); List<Right> getRightsForUserAndWarehouse(Long userId, Long warehouseId); List<Right> getRightsForUserFacilityAndProductCode(Long userId, Long facilityId, String productCode); RightType getRightTypeForRoleId(Long roleId);  }