@Test public void getBulkExtractAppsTest() { when(repository.findAll("application", new NeutralQuery())).thenReturn( Arrays.asList( buildAppEntity("1", true, true), buildAppEntity("2", false, false), buildAppEntity("3", true, false), buildAppEntity("4", false, true), buildAppEntity("5", true, true) ) ); Set<String> bulkExtractApps = helper.getBulkExtractApps(); bulkExtractApps.removeAll(Arrays.asList("1","5")); assertTrue(bulkExtractApps.isEmpty()); }
@SuppressWarnings("unchecked") public Set<String> getBulkExtractApps() { TenantContext.setIsSystemCall(true); Iterable<Entity> apps = repository.findAll("application", new NeutralQuery()); TenantContext.setIsSystemCall(false); Set<String> appIds = new HashSet<String>(); for (Entity app : apps) { if (app.getBody().containsKey("isBulkExtract") && (Boolean) app.getBody().get("isBulkExtract")) { if (app.getBody().containsKey("registration") && "APPROVED".equals(((Map<String, Object>) app.getBody().get("registration")).get("status"))) { appIds.add(app.getEntityId()); } } } return appIds; }
EdOrgExtractHelper implements InitializingBean { @SuppressWarnings("unchecked") public Set<String> getBulkExtractApps() { TenantContext.setIsSystemCall(true); Iterable<Entity> apps = repository.findAll("application", new NeutralQuery()); TenantContext.setIsSystemCall(false); Set<String> appIds = new HashSet<String>(); for (Entity app : apps) { if (app.getBody().containsKey("isBulkExtract") && (Boolean) app.getBody().get("isBulkExtract")) { if (app.getBody().containsKey("registration") && "APPROVED".equals(((Map<String, Object>) app.getBody().get("registration")).get("status"))) { appIds.add(app.getEntityId()); } } } return appIds; } }
EdOrgExtractHelper implements InitializingBean { @SuppressWarnings("unchecked") public Set<String> getBulkExtractApps() { TenantContext.setIsSystemCall(true); Iterable<Entity> apps = repository.findAll("application", new NeutralQuery()); TenantContext.setIsSystemCall(false); Set<String> appIds = new HashSet<String>(); for (Entity app : apps) { if (app.getBody().containsKey("isBulkExtract") && (Boolean) app.getBody().get("isBulkExtract")) { if (app.getBody().containsKey("registration") && "APPROVED".equals(((Map<String, Object>) app.getBody().get("registration")).get("status"))) { appIds.add(app.getEntityId()); } } } return appIds; }  }
EdOrgExtractHelper implements InitializingBean { @SuppressWarnings("unchecked") public Set<String> getBulkExtractApps() { TenantContext.setIsSystemCall(true); Iterable<Entity> apps = repository.findAll("application", new NeutralQuery()); TenantContext.setIsSystemCall(false); Set<String> appIds = new HashSet<String>(); for (Entity app : apps) { if (app.getBody().containsKey("isBulkExtract") && (Boolean) app.getBody().get("isBulkExtract")) { if (app.getBody().containsKey("registration") && "APPROVED".equals(((Map<String, Object>) app.getBody().get("registration")).get("status"))) { appIds.add(app.getEntityId()); } } } return appIds; }  @Override void afterPropertiesSet(); Set<String> getBulkExtractEdOrgs(); Map<String, Set<String>> getBulkExtractEdOrgsPerApp(); @SuppressWarnings("unchecked") Set<String> getBulkExtractApps(); Set<String> getChildEdOrgs(Collection<String> edOrgs); Iterable<Entity> retrieveSEOAS(String teacherId, String edorgId); void logSecurityEvent(Set<String> leas, String entityName, String className); void setSecurityEventUtil(SecurityEventUtil securityEventUtil); Map<String, List<String>> getEdOrgLineages(); void setEdOrgLineages(Map<String, List<String>> edOrgLineages); }
EdOrgExtractHelper implements InitializingBean { @SuppressWarnings("unchecked") public Set<String> getBulkExtractApps() { TenantContext.setIsSystemCall(true); Iterable<Entity> apps = repository.findAll("application", new NeutralQuery()); TenantContext.setIsSystemCall(false); Set<String> appIds = new HashSet<String>(); for (Entity app : apps) { if (app.getBody().containsKey("isBulkExtract") && (Boolean) app.getBody().get("isBulkExtract")) { if (app.getBody().containsKey("registration") && "APPROVED".equals(((Map<String, Object>) app.getBody().get("registration")).get("status"))) { appIds.add(app.getEntityId()); } } } return appIds; }  @Override void afterPropertiesSet(); Set<String> getBulkExtractEdOrgs(); Map<String, Set<String>> getBulkExtractEdOrgsPerApp(); @SuppressWarnings("unchecked") Set<String> getBulkExtractApps(); Set<String> getChildEdOrgs(Collection<String> edOrgs); Iterable<Entity> retrieveSEOAS(String teacherId, String edorgId); void logSecurityEvent(Set<String> leas, String entityName, String className); void setSecurityEventUtil(SecurityEventUtil securityEventUtil); Map<String, List<String>> getEdOrgLineages(); void setEdOrgLineages(Map<String, List<String>> edOrgLineages);  }