@Test public void downconvertShouldDeleteAssessmentFamilyHierarchyExistingAssessment() { Entity existingAssessment = createDownConvertEntity(); existingAssessment.getBody().put(ASSESSMENT_FAMILY_REFERENCE, assessmentFamilyA.getEntityId()); when(template.findById(existingAssessment.getEntityId(), Entity.class, EntityNames.ASSESSMENT)).thenReturn(existingAssessment); Entity updatedAssessment = createDownConvertEntity(); updatedAssessment.getBody().put("assessmentTitle", "A_new_title"); assessmentConverter.bodyFieldToSubdoc(updatedAssessment); assertNull(updatedAssessment.getBody().get(ASSESSMENT_FAMILY_HIERARCHY)); assertEquals(existingAssessment.getBody().get(ASSESSMENT_FAMILY_REFERENCE), updatedAssessment.getBody().get(ASSESSMENT_FAMILY_REFERENCE)); assertEquals("A_new_title", updatedAssessment.getBody().get("assessmentTitle")); }
@Override public void bodyFieldToSubdoc(Entity entity) { bodyFieldToSubdoc(entity, null); }
AssessmentConverter extends GenericSuperdocConverter implements SuperdocConverter { @Override public void bodyFieldToSubdoc(Entity entity) { bodyFieldToSubdoc(entity, null); } }
AssessmentConverter extends GenericSuperdocConverter implements SuperdocConverter { @Override public void bodyFieldToSubdoc(Entity entity) { bodyFieldToSubdoc(entity, null); }  }
AssessmentConverter extends GenericSuperdocConverter implements SuperdocConverter { @Override public void bodyFieldToSubdoc(Entity entity) { bodyFieldToSubdoc(entity, null); }  @Override Entity subdocToBodyField(Entity entity); @Override void bodyFieldToSubdoc(Entity entity); @Override void bodyFieldToSubdoc(Entity entity, SuperdocConverter.Option option); List<Map<String, Object>> extractAssessmentItems(List<Entity> objectiveAssessments, String parentKey); @Override Iterable<Entity> subdocToBodyField(Iterable<Entity> entities); @Override void bodyFieldToSubdoc(Iterable<Entity> entities); @Override void bodyFieldToSubdoc(Iterable<Entity> entities, SuperdocConverter.Option option); }
AssessmentConverter extends GenericSuperdocConverter implements SuperdocConverter { @Override public void bodyFieldToSubdoc(Entity entity) { bodyFieldToSubdoc(entity, null); }  @Override Entity subdocToBodyField(Entity entity); @Override void bodyFieldToSubdoc(Entity entity); @Override void bodyFieldToSubdoc(Entity entity, SuperdocConverter.Option option); List<Map<String, Object>> extractAssessmentItems(List<Entity> objectiveAssessments, String parentKey); @Override Iterable<Entity> subdocToBodyField(Iterable<Entity> entities); @Override void bodyFieldToSubdoc(Iterable<Entity> entities); @Override void bodyFieldToSubdoc(Iterable<Entity> entities, SuperdocConverter.Option option);  }