@Test public void testShouldReturnRolesForCodes() throws Exception { RoleSearchCriteria roleSearchCriteria = RoleSearchCriteria.builder().build(); List<Object> expectedRoles = getRoles(); when(repository.run(Mockito.any(RoleFinderQueryBuilder.class), Mockito.any(RoleRowMapper.class))) .thenReturn(expectedRoles); List<Role> actualActions = roleService.getRoles(roleSearchCriteria); assertEquals(expectedRoles, actualActions); }
public List<Role> getRoles(RoleSearchCriteria roleSearchCriteria) { RoleFinderQueryBuilder queryBuilder = new RoleFinderQueryBuilder(roleSearchCriteria); return (List<Role>) (List<?>) repository.run(queryBuilder, new RoleRowMapper()); }
RoleService { public List<Role> getRoles(RoleSearchCriteria roleSearchCriteria) { RoleFinderQueryBuilder queryBuilder = new RoleFinderQueryBuilder(roleSearchCriteria); return (List<Role>) (List<?>) repository.run(queryBuilder, new RoleRowMapper()); } }
RoleService { public List<Role> getRoles(RoleSearchCriteria roleSearchCriteria) { RoleFinderQueryBuilder queryBuilder = new RoleFinderQueryBuilder(roleSearchCriteria); return (List<Role>) (List<?>) repository.run(queryBuilder, new RoleRowMapper()); } @Autowired  RoleService(BaseRepository repository, RoleRepository roleRepository); }
RoleService { public List<Role> getRoles(RoleSearchCriteria roleSearchCriteria) { RoleFinderQueryBuilder queryBuilder = new RoleFinderQueryBuilder(roleSearchCriteria); return (List<Role>) (List<?>) repository.run(queryBuilder, new RoleRowMapper()); } @Autowired  RoleService(BaseRepository repository, RoleRepository roleRepository); List<Role> getRoles(RoleSearchCriteria roleSearchCriteria); List<Role> getRolesfromMDMS(RoleSearchCriteria roleSearchCriteria); List<Role> createRole(RoleRequest roleRequest); List<Role> updateRole(RoleRequest roleRequest); boolean checkRoleNameDuplicationValidationErrors(String roleName); }
RoleService { public List<Role> getRoles(RoleSearchCriteria roleSearchCriteria) { RoleFinderQueryBuilder queryBuilder = new RoleFinderQueryBuilder(roleSearchCriteria); return (List<Role>) (List<?>) repository.run(queryBuilder, new RoleRowMapper()); } @Autowired  RoleService(BaseRepository repository, RoleRepository roleRepository); List<Role> getRoles(RoleSearchCriteria roleSearchCriteria); List<Role> getRolesfromMDMS(RoleSearchCriteria roleSearchCriteria); List<Role> createRole(RoleRequest roleRequest); List<Role> updateRole(RoleRequest roleRequest); boolean checkRoleNameDuplicationValidationErrors(String roleName);  }