@Test void buildEnvironmentBundleWithProps_ignoringStatic() { ClusterPropertyEntityBuilder builder = new ClusterPropertyEntityBuilder(ID_GENERATOR); Bundle bundle = new Bundle(); bundle.putAllStaticProperties(STATIC_PROPS); bundle.putAllGlobalEnvironmentProperties(ENV_PROPS); final List<Entity> entities = builder.build(bundle, BundleType.ENVIRONMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument()); assertExpectedProperties(entities, ImmutableMap.<String, PropertiesEntity>builder().putAll(ENV_PROPS).build()); }
public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { Map<String, GlobalEnvironmentProperty> globalEnvironmentProperties = Optional.ofNullable(bundle.getGlobalEnvironmentProperties()).orElse(Collections.emptyMap()); Map<String, ClusterProperty> clusterPropertyMap = Optional.ofNullable(bundle.getStaticProperties()).orElse(Collections.emptyMap()); return buildEntities(globalEnvironmentProperties, clusterPropertyMap, bundleType, document); }
ClusterPropertyEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { Map<String, GlobalEnvironmentProperty> globalEnvironmentProperties = Optional.ofNullable(bundle.getGlobalEnvironmentProperties()).orElse(Collections.emptyMap()); Map<String, ClusterProperty> clusterPropertyMap = Optional.ofNullable(bundle.getStaticProperties()).orElse(Collections.emptyMap()); return buildEntities(globalEnvironmentProperties, clusterPropertyMap, bundleType, document); } }
ClusterPropertyEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { Map<String, GlobalEnvironmentProperty> globalEnvironmentProperties = Optional.ofNullable(bundle.getGlobalEnvironmentProperties()).orElse(Collections.emptyMap()); Map<String, ClusterProperty> clusterPropertyMap = Optional.ofNullable(bundle.getStaticProperties()).orElse(Collections.emptyMap()); return buildEntities(globalEnvironmentProperties, clusterPropertyMap, bundleType, document); } @Inject  ClusterPropertyEntityBuilder(IdGenerator idGenerator); }
ClusterPropertyEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { Map<String, GlobalEnvironmentProperty> globalEnvironmentProperties = Optional.ofNullable(bundle.getGlobalEnvironmentProperties()).orElse(Collections.emptyMap()); Map<String, ClusterProperty> clusterPropertyMap = Optional.ofNullable(bundle.getStaticProperties()).orElse(Collections.emptyMap()); return buildEntities(globalEnvironmentProperties, clusterPropertyMap, bundleType, document); } @Inject  ClusterPropertyEntityBuilder(IdGenerator idGenerator); List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder(); }
ClusterPropertyEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { Map<String, GlobalEnvironmentProperty> globalEnvironmentProperties = Optional.ofNullable(bundle.getGlobalEnvironmentProperties()).orElse(Collections.emptyMap()); Map<String, ClusterProperty> clusterPropertyMap = Optional.ofNullable(bundle.getStaticProperties()).orElse(Collections.emptyMap()); return buildEntities(globalEnvironmentProperties, clusterPropertyMap, bundleType, document); } @Inject  ClusterPropertyEntityBuilder(IdGenerator idGenerator); List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @Override @NotNull Integer getOrder();  }