@Test void testGetModulesReport() { EntityType entityType = getMockEntityType(); when(dataExplorerSettings.getModReports()).thenReturn(true); when(userPermissionEvaluator.hasPermission( new EntityTypeIdentity(entityType), EntityTypeReportPermission.VIEW_REPORT)) .thenReturn(true); when(dataExplorerSettings.getEntityReport("MyEntityType")).thenReturn("MyEntityReport"); assertEquals(singletonList(REPORT), dataExplorerServiceImpl.getModules(entityType)); }
@Override public List<Module> getModules(EntityType entityType) { List<Module> modules = new ArrayList<>(); for (Module module : Module.values()) { boolean includeModule; switch (module) { case DATA: includeModule = includeDataModule(entityType); break; case AGGREGATION: includeModule = includeAggregationModule(entityType); break; case REPORT: includeModule = includeReportModule(entityType); break; default: throw new UnexpectedEnumException(module); } if (includeModule) { modules.add(module); } } return modules; }
DataExplorerServiceImpl implements DataExplorerService { @Override public List<Module> getModules(EntityType entityType) { List<Module> modules = new ArrayList<>(); for (Module module : Module.values()) { boolean includeModule; switch (module) { case DATA: includeModule = includeDataModule(entityType); break; case AGGREGATION: includeModule = includeAggregationModule(entityType); break; case REPORT: includeModule = includeReportModule(entityType); break; default: throw new UnexpectedEnumException(module); } if (includeModule) { modules.add(module); } } return modules; } }
DataExplorerServiceImpl implements DataExplorerService { @Override public List<Module> getModules(EntityType entityType) { List<Module> modules = new ArrayList<>(); for (Module module : Module.values()) { boolean includeModule; switch (module) { case DATA: includeModule = includeDataModule(entityType); break; case AGGREGATION: includeModule = includeAggregationModule(entityType); break; case REPORT: includeModule = includeReportModule(entityType); break; default: throw new UnexpectedEnumException(module); } if (includeModule) { modules.add(module); } } return modules; } DataExplorerServiceImpl(
      DataExplorerSettings dataExplorerSettings, UserPermissionEvaluator userPermissionEvaluator); }
DataExplorerServiceImpl implements DataExplorerService { @Override public List<Module> getModules(EntityType entityType) { List<Module> modules = new ArrayList<>(); for (Module module : Module.values()) { boolean includeModule; switch (module) { case DATA: includeModule = includeDataModule(entityType); break; case AGGREGATION: includeModule = includeAggregationModule(entityType); break; case REPORT: includeModule = includeReportModule(entityType); break; default: throw new UnexpectedEnumException(module); } if (includeModule) { modules.add(module); } } return modules; } DataExplorerServiceImpl(
      DataExplorerSettings dataExplorerSettings, UserPermissionEvaluator userPermissionEvaluator); @Override List<Module> getModules(EntityType entityType); }
DataExplorerServiceImpl implements DataExplorerService { @Override public List<Module> getModules(EntityType entityType) { List<Module> modules = new ArrayList<>(); for (Module module : Module.values()) { boolean includeModule; switch (module) { case DATA: includeModule = includeDataModule(entityType); break; case AGGREGATION: includeModule = includeAggregationModule(entityType); break; case REPORT: includeModule = includeReportModule(entityType); break; default: throw new UnexpectedEnumException(module); } if (includeModule) { modules.add(module); } } return modules; } DataExplorerServiceImpl(
      DataExplorerSettings dataExplorerSettings, UserPermissionEvaluator userPermissionEvaluator); @Override List<Module> getModules(EntityType entityType);  }