@Test public void testEnvironmentBuildForEmptyEntities() { UnsupportedEntityBuilder unsupportedEntityBuilder = new UnsupportedEntityBuilder(); List<Entity> entities = unsupportedEntityBuilder.build(new Bundle(), EntityBuilder.BundleType.ENVIRONMENT, null); Assert.assertTrue(entities.isEmpty()); entities = unsupportedEntityBuilder.build(new AnnotatedBundle(null, null, null), EntityBuilder.BundleType.DEPLOYMENT, null); Assert.assertTrue(entities.isEmpty()); }
@Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { List<Entity> unsupportedEntities = new ArrayList<>(); Map<String, UnsupportedGatewayEntity> unsupportedGatewayEntityMap = bundle.getUnsupportedEntities(); unsupportedGatewayEntityMap.forEach((key, value) -> { if (bundleType != ENVIRONMENT || value.isExcluded()) { unsupportedEntities.add(EntityBuilderHelper.getEntityWithOnlyMapping(value.getType(), value.getName() , value.getId())); } else { Element resourceElement = (Element) document.adoptNode(value.getElement()); unsupportedEntities.add(EntityBuilderHelper.getEntityWithNameMapping(value.getType(), value.getName() , value.getId(), resourceElement)); } }); return unsupportedEntities; }
UnsupportedEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { List<Entity> unsupportedEntities = new ArrayList<>(); Map<String, UnsupportedGatewayEntity> unsupportedGatewayEntityMap = bundle.getUnsupportedEntities(); unsupportedGatewayEntityMap.forEach((key, value) -> { if (bundleType != ENVIRONMENT || value.isExcluded()) { unsupportedEntities.add(EntityBuilderHelper.getEntityWithOnlyMapping(value.getType(), value.getName() , value.getId())); } else { Element resourceElement = (Element) document.adoptNode(value.getElement()); unsupportedEntities.add(EntityBuilderHelper.getEntityWithNameMapping(value.getType(), value.getName() , value.getId(), resourceElement)); } }); return unsupportedEntities; } }
UnsupportedEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { List<Entity> unsupportedEntities = new ArrayList<>(); Map<String, UnsupportedGatewayEntity> unsupportedGatewayEntityMap = bundle.getUnsupportedEntities(); unsupportedGatewayEntityMap.forEach((key, value) -> { if (bundleType != ENVIRONMENT || value.isExcluded()) { unsupportedEntities.add(EntityBuilderHelper.getEntityWithOnlyMapping(value.getType(), value.getName() , value.getId())); } else { Element resourceElement = (Element) document.adoptNode(value.getElement()); unsupportedEntities.add(EntityBuilderHelper.getEntityWithNameMapping(value.getType(), value.getName() , value.getId(), resourceElement)); } }); return unsupportedEntities; }  }
UnsupportedEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { List<Entity> unsupportedEntities = new ArrayList<>(); Map<String, UnsupportedGatewayEntity> unsupportedGatewayEntityMap = bundle.getUnsupportedEntities(); unsupportedGatewayEntityMap.forEach((key, value) -> { if (bundleType != ENVIRONMENT || value.isExcluded()) { unsupportedEntities.add(EntityBuilderHelper.getEntityWithOnlyMapping(value.getType(), value.getName() , value.getId())); } else { Element resourceElement = (Element) document.adoptNode(value.getElement()); unsupportedEntities.add(EntityBuilderHelper.getEntityWithNameMapping(value.getType(), value.getName() , value.getId(), resourceElement)); } }); return unsupportedEntities; }  @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder(); }
UnsupportedEntityBuilder implements EntityBuilder { @Override public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { List<Entity> unsupportedEntities = new ArrayList<>(); Map<String, UnsupportedGatewayEntity> unsupportedGatewayEntityMap = bundle.getUnsupportedEntities(); unsupportedGatewayEntityMap.forEach((key, value) -> { if (bundleType != ENVIRONMENT || value.isExcluded()) { unsupportedEntities.add(EntityBuilderHelper.getEntityWithOnlyMapping(value.getType(), value.getName() , value.getId())); } else { Element resourceElement = (Element) document.adoptNode(value.getElement()); unsupportedEntities.add(EntityBuilderHelper.getEntityWithNameMapping(value.getType(), value.getName() , value.getId(), resourceElement)); } }); return unsupportedEntities; }  @Override List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder();  }