@Test public void buildActiveConnectors() { final SsgActiveConnectorEntityBuilder builder = new SsgActiveConnectorEntityBuilder(new IdGenerator()); List<Entity> activeConnectors = builder.build(getTestBundle(), EntityBuilder.BundleType.ENVIRONMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument()); assertEquals(1, activeConnectors.size()); Entity ssgActiveConnector = activeConnectors.get(0); assertEquals("::testGroup::testName::1.0", ssgActiveConnector.getName()); Element element = ssgActiveConnector.getXml(); assertEquals("testServiceId", DocumentUtils.getSingleChildElementTextContent(element, BundleElementNames.HARDWIRED)); activeConnectors = builder.build(getTestAnnotatedBundle(), EntityBuilder.BundleType.ENVIRONMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument()); assertEquals(1, activeConnectors.size()); }
@Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, SsgActiveConnector> activeConnectorMap = Optional.ofNullable(bundle.getSsgActiveConnectors()).orElse(Collections.emptyMap()); return buildEntities(activeConnectorMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getSsgActiveConnectors(), bundle, bundleType, document); } }
SsgActiveConnectorEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, SsgActiveConnector> activeConnectorMap = Optional.ofNullable(bundle.getSsgActiveConnectors()).orElse(Collections.emptyMap()); return buildEntities(activeConnectorMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getSsgActiveConnectors(), bundle, bundleType, document); } } }
SsgActiveConnectorEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, SsgActiveConnector> activeConnectorMap = Optional.ofNullable(bundle.getSsgActiveConnectors()).orElse(Collections.emptyMap()); return buildEntities(activeConnectorMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getSsgActiveConnectors(), bundle, bundleType, document); } } @Inject  SsgActiveConnectorEntityBuilder(IdGenerator idGenerator); }
SsgActiveConnectorEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, SsgActiveConnector> activeConnectorMap = Optional.ofNullable(bundle.getSsgActiveConnectors()).orElse(Collections.emptyMap()); return buildEntities(activeConnectorMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getSsgActiveConnectors(), bundle, bundleType, document); } } @Inject  SsgActiveConnectorEntityBuilder(IdGenerator idGenerator); @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder(); }
SsgActiveConnectorEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, SsgActiveConnector> activeConnectorMap = Optional.ofNullable(bundle.getSsgActiveConnectors()).orElse(Collections.emptyMap()); return buildEntities(activeConnectorMap, ((AnnotatedBundle) bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getSsgActiveConnectors(), bundle, bundleType, document); } } @Inject  SsgActiveConnectorEntityBuilder(IdGenerator idGenerator); @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder();  }