@Test void buildEnvironmentWithPBS() { final Bundle bundle = new Bundle(); putPolicy(bundle); PolicyBackedServiceEntityBuilder builder = new PolicyBackedServiceEntityBuilder(ID_GENERATOR); bundle.putAllPolicyBackedServices(ImmutableMap.of(TEST_PBS, buildTestPBS())); final List<Entity> entities = builder.build(bundle, BundleType.ENVIRONMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument()); assertTrue(entities.isEmpty()); }
public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, PolicyBackedService> policyBackedServiceMap = Optional.ofNullable(bundle.getPolicyBackedServices()).orElse(Collections.emptyMap()); return buildEntities(policyBackedServiceMap, ((AnnotatedBundle)bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getPolicyBackedServices(), bundle, bundleType, document); } }
PolicyBackedServiceEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, PolicyBackedService> policyBackedServiceMap = Optional.ofNullable(bundle.getPolicyBackedServices()).orElse(Collections.emptyMap()); return buildEntities(policyBackedServiceMap, ((AnnotatedBundle)bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getPolicyBackedServices(), bundle, bundleType, document); } } }
PolicyBackedServiceEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, PolicyBackedService> policyBackedServiceMap = Optional.ofNullable(bundle.getPolicyBackedServices()).orElse(Collections.emptyMap()); return buildEntities(policyBackedServiceMap, ((AnnotatedBundle)bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getPolicyBackedServices(), bundle, bundleType, document); } } @Inject  PolicyBackedServiceEntityBuilder(IdGenerator idGenerator); }
PolicyBackedServiceEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, PolicyBackedService> policyBackedServiceMap = Optional.ofNullable(bundle.getPolicyBackedServices()).orElse(Collections.emptyMap()); return buildEntities(policyBackedServiceMap, ((AnnotatedBundle)bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getPolicyBackedServices(), bundle, bundleType, document); } } @Inject  PolicyBackedServiceEntityBuilder(IdGenerator idGenerator); List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder(); }
PolicyBackedServiceEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { Map<String, PolicyBackedService> policyBackedServiceMap = Optional.ofNullable(bundle.getPolicyBackedServices()).orElse(Collections.emptyMap()); return buildEntities(policyBackedServiceMap, ((AnnotatedBundle)bundle).getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getPolicyBackedServices(), bundle, bundleType, document); } } @Inject  PolicyBackedServiceEntityBuilder(IdGenerator idGenerator); List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder();  }