@Test void buildFromEmptyBundle_noConnections() { JmsDestinationEntityBuilder builder = new JmsDestinationEntityBuilder(ID_GENERATOR); final List<Entity> entities = builder.build(new Bundle(), EntityBuilder.BundleType.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, JmsDestination> jmsDestinationMap = Optional.ofNullable(bundle.getJmsDestinations()).orElse(Collections.emptyMap()); return buildEntities(jmsDestinationMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getJmsDestinations(), bundle, bundleType, document); } }
JmsDestinationEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, JmsDestination> jmsDestinationMap = Optional.ofNullable(bundle.getJmsDestinations()).orElse(Collections.emptyMap()); return buildEntities(jmsDestinationMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getJmsDestinations(), bundle, bundleType, document); } } }
JmsDestinationEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, JmsDestination> jmsDestinationMap = Optional.ofNullable(bundle.getJmsDestinations()).orElse(Collections.emptyMap()); return buildEntities(jmsDestinationMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getJmsDestinations(), bundle, bundleType, document); } } @Inject  JmsDestinationEntityBuilder(IdGenerator idGenerator); }
JmsDestinationEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, JmsDestination> jmsDestinationMap = Optional.ofNullable(bundle.getJmsDestinations()).orElse(Collections.emptyMap()); return buildEntities(jmsDestinationMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getJmsDestinations(), bundle, bundleType, document); } } @Inject  JmsDestinationEntityBuilder(IdGenerator idGenerator); @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder(); }
JmsDestinationEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, JmsDestination> jmsDestinationMap = Optional.ofNullable(bundle.getJmsDestinations()).orElse(Collections.emptyMap()); return buildEntities(jmsDestinationMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getJmsDestinations(), bundle, bundleType, document); } } @Inject  JmsDestinationEntityBuilder(IdGenerator idGenerator); @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder();  }