@Test @Sql(scripts = { "/sql/clearAction.sql", "/sql/insertActionData.sql" }) public void testShouldGetmodules() { ActionRequest actionRequest = new ActionRequest(); actionRequest.setRequestInfo(getRequestInfo()); actionRequest.setTenantId("ap.public"); List<String> roleCodes = new ArrayList<String>(); roleCodes.add("SUPERUSER"); actionRequest.setRoleCodes(roleCodes); actionRequest.setEnabled(false); List<Module> modules = actionRepository.getAllActionsBasedOnRoles(actionRequest).getModules(); assertThat(modules.size()).isEqualTo(0); }
public ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest) { ActionService service = new ActionService(); service.setModules(new ArrayList<Module>()); List<Module> moduleList = null; List<Module> allServiceList = null; Map<String, List<Action>> actionMap = getActionsQueryBuilder(actionRequest); if (actionMap.size() > 0) { moduleList = getServiceQueryBuilder(actionRequest, actionMap); } if (moduleList != null && moduleList.size() > 0) { allServiceList = getAllServicesQueryBuilder(actionRequest, moduleList); } if (allServiceList != null && allServiceList.size() > 0) { List<Module> rootModules = prepareListOfRootModules(allServiceList, actionMap); for (Module module : rootModules) { getSubmodule(module, allServiceList, actionMap); } removeMainModuleDoesnotExistActions(rootModules); service.setModules(rootModules); } return service; }
ActionRepository { public ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest) { ActionService service = new ActionService(); service.setModules(new ArrayList<Module>()); List<Module> moduleList = null; List<Module> allServiceList = null; Map<String, List<Action>> actionMap = getActionsQueryBuilder(actionRequest); if (actionMap.size() > 0) { moduleList = getServiceQueryBuilder(actionRequest, actionMap); } if (moduleList != null && moduleList.size() > 0) { allServiceList = getAllServicesQueryBuilder(actionRequest, moduleList); } if (allServiceList != null && allServiceList.size() > 0) { List<Module> rootModules = prepareListOfRootModules(allServiceList, actionMap); for (Module module : rootModules) { getSubmodule(module, allServiceList, actionMap); } removeMainModuleDoesnotExistActions(rootModules); service.setModules(rootModules); } return service; } }
ActionRepository { public ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest) { ActionService service = new ActionService(); service.setModules(new ArrayList<Module>()); List<Module> moduleList = null; List<Module> allServiceList = null; Map<String, List<Action>> actionMap = getActionsQueryBuilder(actionRequest); if (actionMap.size() > 0) { moduleList = getServiceQueryBuilder(actionRequest, actionMap); } if (moduleList != null && moduleList.size() > 0) { allServiceList = getAllServicesQueryBuilder(actionRequest, moduleList); } if (allServiceList != null && allServiceList.size() > 0) { List<Module> rootModules = prepareListOfRootModules(allServiceList, actionMap); for (Module module : rootModules) { getSubmodule(module, allServiceList, actionMap); } removeMainModuleDoesnotExistActions(rootModules); service.setModules(rootModules); } return service; }  }
ActionRepository { public ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest) { ActionService service = new ActionService(); service.setModules(new ArrayList<Module>()); List<Module> moduleList = null; List<Module> allServiceList = null; Map<String, List<Action>> actionMap = getActionsQueryBuilder(actionRequest); if (actionMap.size() > 0) { moduleList = getServiceQueryBuilder(actionRequest, actionMap); } if (moduleList != null && moduleList.size() > 0) { allServiceList = getAllServicesQueryBuilder(actionRequest, moduleList); } if (allServiceList != null && allServiceList.size() > 0) { List<Module> rootModules = prepareListOfRootModules(allServiceList, actionMap); for (Module module : rootModules) { getSubmodule(module, allServiceList, actionMap); } removeMainModuleDoesnotExistActions(rootModules); service.setModules(rootModules); } return service; }  List<Action> createAction(final ActionRequest actionRequest); List<Action> updateAction(final ActionRequest actionRequest); boolean checkActionNameExit(String actionName); boolean checkCombinationOfUrlAndqueryparamsExist(String url, String queryParams); ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest); List<Action> getAllActions(ActionRequest actionRequest); List<Action> getAllMDMSActions(ActionRequest actionRequest); static RequestInfo getRInfo(); }
ActionRepository { public ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest) { ActionService service = new ActionService(); service.setModules(new ArrayList<Module>()); List<Module> moduleList = null; List<Module> allServiceList = null; Map<String, List<Action>> actionMap = getActionsQueryBuilder(actionRequest); if (actionMap.size() > 0) { moduleList = getServiceQueryBuilder(actionRequest, actionMap); } if (moduleList != null && moduleList.size() > 0) { allServiceList = getAllServicesQueryBuilder(actionRequest, moduleList); } if (allServiceList != null && allServiceList.size() > 0) { List<Module> rootModules = prepareListOfRootModules(allServiceList, actionMap); for (Module module : rootModules) { getSubmodule(module, allServiceList, actionMap); } removeMainModuleDoesnotExistActions(rootModules); service.setModules(rootModules); } return service; }  List<Action> createAction(final ActionRequest actionRequest); List<Action> updateAction(final ActionRequest actionRequest); boolean checkActionNameExit(String actionName); boolean checkCombinationOfUrlAndqueryparamsExist(String url, String queryParams); ActionService getAllActionsBasedOnRoles(ActionRequest actionRequest); List<Action> getAllActions(ActionRequest actionRequest); List<Action> getAllMDMSActions(ActionRequest actionRequest); static RequestInfo getRInfo(); static final Logger LOGGER; }