@Test void buildEnvironment() { final Bundle bundle = new Bundle(); ScheduledTaskEntityBuilder builder = new ScheduledTaskEntityBuilder(ID_GENERATOR); ScheduledTask scheduledTask = buildTestScheduledTask(false); bundle.putAllScheduledTasks(ImmutableMap.of(TEST_SCHEDULED_TASK, scheduledTask)); final List<Entity> entities = builder.build(bundle, ENVIRONMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument()); assertTrue(entities.isEmpty()); }
@Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, ScheduledTask> scheduledTaskMap = Optional.ofNullable(bundle.getScheduledTasks()).orElse(Collections.emptyMap()); return buildEntities(scheduledTaskMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getScheduledTasks(), bundle, bundleType, document); } }
ScheduledTaskEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, ScheduledTask> scheduledTaskMap = Optional.ofNullable(bundle.getScheduledTasks()).orElse(Collections.emptyMap()); return buildEntities(scheduledTaskMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getScheduledTasks(), bundle, bundleType, document); } } }
ScheduledTaskEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, ScheduledTask> scheduledTaskMap = Optional.ofNullable(bundle.getScheduledTasks()).orElse(Collections.emptyMap()); return buildEntities(scheduledTaskMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getScheduledTasks(), bundle, bundleType, document); } } @Inject  ScheduledTaskEntityBuilder(IdGenerator idGenerator); }
ScheduledTaskEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, ScheduledTask> scheduledTaskMap = Optional.ofNullable(bundle.getScheduledTasks()).orElse(Collections.emptyMap()); return buildEntities(scheduledTaskMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getScheduledTasks(), bundle, bundleType, document); } } @Inject  ScheduledTaskEntityBuilder(IdGenerator idGenerator); @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder(); }
ScheduledTaskEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, ScheduledTask> scheduledTaskMap = Optional.ofNullable(bundle.getScheduledTasks()).orElse(Collections.emptyMap()); return buildEntities(scheduledTaskMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getScheduledTasks(), bundle, bundleType, document); } } @Inject  ScheduledTaskEntityBuilder(IdGenerator idGenerator); @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder();  }