@Test public void testDuplicateApplication() { Map<String, Object> body = new HashMap<String, Object>(); body.put("schoolYearAttendance", new Object()); Entity entity = new BulkExtractEntity(body, "student"); Entity treated = treat.apply(entity); Assert.assertEquals(entity, treated); }
@Override public Entity apply(Entity entity) { if (entity.getBody().containsKey("schoolYearAttendance")) { LOG.debug("Treatment has already been applied to attendance entity: {}", new Object[] { entity.getEntityId() }); return entity; } Map<String,Object> treated = AttendanceStrategyHelper.wrap(entity.getBody()); entity.getBody().clear(); entity.getBody().putAll(treated); return entity; }
AttendanceTreatment implements Treatment { @Override public Entity apply(Entity entity) { if (entity.getBody().containsKey("schoolYearAttendance")) { LOG.debug("Treatment has already been applied to attendance entity: {}", new Object[] { entity.getEntityId() }); return entity; } Map<String,Object> treated = AttendanceStrategyHelper.wrap(entity.getBody()); entity.getBody().clear(); entity.getBody().putAll(treated); return entity; } }
AttendanceTreatment implements Treatment { @Override public Entity apply(Entity entity) { if (entity.getBody().containsKey("schoolYearAttendance")) { LOG.debug("Treatment has already been applied to attendance entity: {}", new Object[] { entity.getEntityId() }); return entity; } Map<String,Object> treated = AttendanceStrategyHelper.wrap(entity.getBody()); entity.getBody().clear(); entity.getBody().putAll(treated); return entity; }  }
AttendanceTreatment implements Treatment { @Override public Entity apply(Entity entity) { if (entity.getBody().containsKey("schoolYearAttendance")) { LOG.debug("Treatment has already been applied to attendance entity: {}", new Object[] { entity.getEntityId() }); return entity; } Map<String,Object> treated = AttendanceStrategyHelper.wrap(entity.getBody()); entity.getBody().clear(); entity.getBody().putAll(treated); return entity; }  @Override Entity apply(Entity entity); }
AttendanceTreatment implements Treatment { @Override public Entity apply(Entity entity) { if (entity.getBody().containsKey("schoolYearAttendance")) { LOG.debug("Treatment has already been applied to attendance entity: {}", new Object[] { entity.getEntityId() }); return entity; } Map<String,Object> treated = AttendanceStrategyHelper.wrap(entity.getBody()); entity.getBody().clear(); entity.getBody().putAll(treated); return entity; }  @Override Entity apply(Entity entity);  }