@Test public void shouldCreateOneToManyTranslatedEntities() { List<SliEntity> sliEntities = sifTranslationManager.translate(sifA, "zoneId"); Assert.assertEquals("Should translate to two sli entities", 2, sliEntities.size()); Assert.assertEquals("First translated entity not of correct", sliX, sliEntities.get(0)); Assert.assertEquals("First translated entity not of correct", sliY, sliEntities.get(1)); }
public List<SliEntity> translate(SIFDataObject sifData, String zoneId) { List<SliEntity> entities = new ArrayList<SliEntity>(); List<TranslationTask> translationTasks = translationMap.get(sifData.getObjectType().toString()); if (translationTasks == null) { LOG.error("No TranslationTask found for sif type: " + sifData.getObjectType()); return entities; } for (TranslationTask translationTask : translationTasks) { try { entities.addAll(translationTask.translate(sifData, zoneId)); } catch (SifTranslationException e) { LOG.error("Sif translation exception: ", e); } } return entities; }
SifTranslationManager { public List<SliEntity> translate(SIFDataObject sifData, String zoneId) { List<SliEntity> entities = new ArrayList<SliEntity>(); List<TranslationTask> translationTasks = translationMap.get(sifData.getObjectType().toString()); if (translationTasks == null) { LOG.error("No TranslationTask found for sif type: " + sifData.getObjectType()); return entities; } for (TranslationTask translationTask : translationTasks) { try { entities.addAll(translationTask.translate(sifData, zoneId)); } catch (SifTranslationException e) { LOG.error("Sif translation exception: ", e); } } return entities; } }
SifTranslationManager { public List<SliEntity> translate(SIFDataObject sifData, String zoneId) { List<SliEntity> entities = new ArrayList<SliEntity>(); List<TranslationTask> translationTasks = translationMap.get(sifData.getObjectType().toString()); if (translationTasks == null) { LOG.error("No TranslationTask found for sif type: " + sifData.getObjectType()); return entities; } for (TranslationTask translationTask : translationTasks) { try { entities.addAll(translationTask.translate(sifData, zoneId)); } catch (SifTranslationException e) { LOG.error("Sif translation exception: ", e); } } return entities; }  }
SifTranslationManager { public List<SliEntity> translate(SIFDataObject sifData, String zoneId) { List<SliEntity> entities = new ArrayList<SliEntity>(); List<TranslationTask> translationTasks = translationMap.get(sifData.getObjectType().toString()); if (translationTasks == null) { LOG.error("No TranslationTask found for sif type: " + sifData.getObjectType()); return entities; } for (TranslationTask translationTask : translationTasks) { try { entities.addAll(translationTask.translate(sifData, zoneId)); } catch (SifTranslationException e) { LOG.error("Sif translation exception: ", e); } } return entities; }  void setTranslationMap(Map<String, List<TranslationTask>> translationMap); List<SliEntity> translate(SIFDataObject sifData, String zoneId); }
SifTranslationManager { public List<SliEntity> translate(SIFDataObject sifData, String zoneId) { List<SliEntity> entities = new ArrayList<SliEntity>(); List<TranslationTask> translationTasks = translationMap.get(sifData.getObjectType().toString()); if (translationTasks == null) { LOG.error("No TranslationTask found for sif type: " + sifData.getObjectType()); return entities; } for (TranslationTask translationTask : translationTasks) { try { entities.addAll(translationTask.translate(sifData, zoneId)); } catch (SifTranslationException e) { LOG.error("Sif translation exception: ", e); } } return entities; }  void setTranslationMap(Map<String, List<TranslationTask>> translationMap); List<SliEntity> translate(SIFDataObject sifData, String zoneId);  }