@Test public void testFetchChildDetails() throws Exception { String itemSet = "{\"id\":986983,\"graphId\":\"domain\",\"identifier\":\"do_11292667205373132811\",\"nodeType\":\"DATA_NODE\",\"objectType\":\"ItemSet\",\"metadata\":{\"owner\":\"Ilimi\",\"lastStatusChangedOn\":\"2020-01-02T16:31:37.174+0530\",\"code\":\"akshara.grade5.ws1.test\",\"previewUrl\":\"https: Map<String, Object> nodeMap = mapper.readValue(itemSet, Map.class); DefinitionDTO d = new ControllerUtil().getDefinition("domain", "ItemSet"); Node node = ConvertToGraphNode.convertToGraphNode(nodeMap, d, null); Relation r = new Relation("do_11292667205373132811", "hasSequenceMember", "test.mcq_test_mcq_101"); Map<String, Object> relationMataData = new HashMap<>(); relationMataData.put("IL_SEQUENCE_INDEX", 1); r.setMetadata(relationMataData); r.setStartNodeObjectType("ItemSet"); r.setEndNodeObjectType("AssessmentItem"); node.setOutRelations(Arrays.asList(r)); System.out.println(node.getOutRelations().size()); Map<String, Object> o = QuestionPaperGenerator.fetchChildDetails(node); Assert.assertNotNull(o); }
public static Map<String, Object> fetchChildDetails(Node node) { return node.getOutRelations().stream() .filter(relation -> StringUtils.equalsIgnoreCase(ASSESSMENT_OBJECT_TYPE, relation.getEndNodeObjectType())) .collect(Collectors.toMap(Relation::getEndNodeId, entry -> entry.getMetadata().get(INDEX))); }
QuestionPaperGenerator { public static Map<String, Object> fetchChildDetails(Node node) { return node.getOutRelations().stream() .filter(relation -> StringUtils.equalsIgnoreCase(ASSESSMENT_OBJECT_TYPE, relation.getEndNodeObjectType())) .collect(Collectors.toMap(Relation::getEndNodeId, entry -> entry.getMetadata().get(INDEX))); } }
QuestionPaperGenerator { public static Map<String, Object> fetchChildDetails(Node node) { return node.getOutRelations().stream() .filter(relation -> StringUtils.equalsIgnoreCase(ASSESSMENT_OBJECT_TYPE, relation.getEndNodeObjectType())) .collect(Collectors.toMap(Relation::getEndNodeId, entry -> entry.getMetadata().get(INDEX))); }  }
QuestionPaperGenerator { public static Map<String, Object> fetchChildDetails(Node node) { return node.getOutRelations().stream() .filter(relation -> StringUtils.equalsIgnoreCase(ASSESSMENT_OBJECT_TYPE, relation.getEndNodeObjectType())) .collect(Collectors.toMap(Relation::getEndNodeId, entry -> entry.getMetadata().get(INDEX))); }  static File generateQuestionPaper(Node node); static Map<String, Object> fetchChildDetails(Node node); static Map<String, Object> getAssessmentDataMap(Map<String, Object> childData); static String getFileName(String prefix); }
QuestionPaperGenerator { public static Map<String, Object> fetchChildDetails(Node node) { return node.getOutRelations().stream() .filter(relation -> StringUtils.equalsIgnoreCase(ASSESSMENT_OBJECT_TYPE, relation.getEndNodeObjectType())) .collect(Collectors.toMap(Relation::getEndNodeId, entry -> entry.getMetadata().get(INDEX))); }  static File generateQuestionPaper(Node node); static Map<String, Object> fetchChildDetails(Node node); static Map<String, Object> getAssessmentDataMap(Map<String, Object> childData); static String getFileName(String prefix);  }