You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2019/12/17 10:58:07 UTC

[sling-whiteboard] branch master updated: Separate out Feature and Bundle builders.

This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 586fc04  Separate out Feature and Bundle builders.
586fc04 is described below

commit 586fc0465613ed03236c3d08fe95dcc1b22fb44d
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Tue Dec 17 10:56:29 2019 +0000

    Separate out Feature and Bundle builders.
---
 .../src/main/java/org/osgi/feature/Artifact.java   |  29 +---
 .../src/main/java/org/osgi/feature/ArtifactID.java |   3 +-
 .../src/main/java/org/osgi/feature/Bundle.java     |  70 +-------
 .../src/main/java/org/osgi/feature/Feature.java    | 177 ++-----------------
 .../{Artifact.java => builder/ArtifactImpl.java}   |  14 +-
 .../org/osgi/feature/builder/BundleBuilder.java    |  89 ++++++++++
 .../org/osgi/feature/builder/FeatureBuilder.java   | 191 +++++++++++++++++++++
 .../org/osgi/feature/impl/FeatureServiceImpl.java  |  11 +-
 .../osgi/feature/impl/FeatureServiceImplTest.java  |  11 +-
 9 files changed, 321 insertions(+), 274 deletions(-)

diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
index 3a9085f..cb3014b 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
@@ -16,31 +16,6 @@
  */
 package org.osgi.feature;
 
-import java.util.Objects;
-
-public class Artifact {
-    private final ArtifactID id;
-
-    protected Artifact(ArtifactID id) {
-        this.id = id;
-    }
-
-    public ArtifactID getID() {
-        return id;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(id);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!(obj instanceof Artifact))
-            return false;
-        Artifact other = (Artifact) obj;
-        return Objects.equals(id, other.id);
-    }
+public interface Artifact {
+    ArtifactID getID();
 }
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/ArtifactID.java b/osgi-featuremodel/src/main/java/org/osgi/feature/ArtifactID.java
index 3a2a8c3..1e55103 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/ArtifactID.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/ArtifactID.java
@@ -91,7 +91,6 @@ public class ArtifactID {
 
     @Override
     public String toString() {
-        return "ArtifactID [groupId=" + groupId + ", artifactId=" + artifactId + ", version=" + version + ", type=" + type
-                + ", classifier=" + classifier + "]";
+        return groupId + ":" + artifactId + ":" + version;
     }
 }
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Bundle.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Bundle.java
index 735f27d..328b30f 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Bundle.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Bundle.java
@@ -16,74 +16,8 @@
  */
 package org.osgi.feature;
 
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.Map;
-import java.util.Objects;
 
-public class Bundle extends Artifact {
-    private final Map<String, Object> metadata;
-
-    private Bundle(ArtifactID id, Map<String,Object> metadata) {
-        super(id);
-
-        this.metadata = Collections.unmodifiableMap(metadata);
-    }
-
-    public Map<String, Object> getMetadata() {
-        return metadata;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + Objects.hash(metadata);
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (!(obj instanceof Bundle))
-            return false;
-        Bundle other = (Bundle) obj;
-        return Objects.equals(metadata, other.metadata);
-    }
-
-    @Override
-    public String toString() {
-        return "Bundle [metadata=" + metadata + ", getID()=" + getID() + "]";
-    }
-
-    public static class Builder {
-        private final ArtifactID id;
-
-        private final Map<String,Object> metadata = new HashMap<>();
-
-        public Builder(ArtifactID id) {
-            this.id = id;
-        }
-
-        public Builder(String groupId, String artifactId, String version) {
-            this(new ArtifactID(groupId, artifactId, version));
-        }
-
-        public Builder addMetadata(String key, Object value) {
-            this.metadata.put(key, value);
-            return this;
-        }
-
-        public Builder addMetadata(Map<String,Object> md) {
-            this.metadata.putAll(md);
-            return this;
-        }
-
-        public Bundle build() {
-            return new Bundle(id, metadata);
-        }
-    }
+public interface Bundle extends Artifact {
+    Map<String, Object> getMetadata();
 }
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java
index e59f074..520d7b7 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Feature.java
@@ -16,180 +16,33 @@
  */
 package org.osgi.feature;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-// Thread Safe
-// Or do we use an interface?
-public class Feature extends Artifact {
-    private final String title;
-    private final String description;
-    private final String vendor;
-    private final String license;
-    private final String location;
-    private final boolean complete;
-    private final boolean isFinal;
+public interface Feature extends Artifact {
+    String getTitle();
 
-    private final List<Bundle> bundles;
-    private final List<Configuration> configurations;
-    private final Map<String, String> variables;
+    String getDescription();
 
-    private Feature(ArtifactID id, String aTitle, String desc, String vnd, String lic, String loc,
-            boolean comp, boolean fin, List<Bundle> bs, List<Configuration> cs, Map<String,String> vars) {
-        super(id);
+    String getVendor();
 
-        title = aTitle;
-        description = desc;
-        vendor = vnd;
-        license = lic;
-        location = loc;
-        complete = comp;
-        isFinal = fin;
+    String getLicense();
 
-        bundles = Collections.unmodifiableList(bs);
-        configurations = Collections.unmodifiableList(cs);
-        variables = Collections.unmodifiableMap(vars);
+    String getLocation();
 
-        // add prototype
-        // add requirements
-        // add capabilities
-        // add framework properties
-    }
+    boolean isComplete();
 
-    public String getTitle() {
-        return title;
-    }
+    boolean isFinal();
 
-    public String getDescription() {
-        return description;
-    }
+    List<Bundle> getBundles();
 
-    public String getVendor() {
-        return vendor;
-    }
+    List<Configuration> getConfigurations();
 
-    public String getLicense() {
-        return license;
-    }
+    Map<String, String> getVariables();
 
-    public String getLocation() {
-        return location;
-    }
+    // add prototype
+    // add requirements
+    // add capabilities
+    // add framework properties
 
-    public boolean isComplete() {
-        return complete;
-    }
-
-    public boolean isFinal() {
-        return isFinal;
-    }
-
-    public List<Bundle> getBundles() {
-        return bundles;
-    }
-
-    public List<Configuration> getConfigurations() {
-        return configurations;
-    }
-
-    public Map<String, String> getVariables() {
-        return variables;
-    }
-
-    @Override
-    public String toString() {
-        return "Feature [title=" + title + ", description=" + description + ", vendor=" + vendor + ", license=" + license
-                + ", location=" + location + ", complete=" + complete + ", isFinal=" + isFinal + ", bundles=" + bundles
-                + ", configurations=" + configurations + ", variables=" + variables + ", getID()=" + getID() + "]";
-    }
-
-    // Not Thread Safe
-    public static class Builder {
-        private final ArtifactID id;
-
-        private String title;
-        private String description;
-        private String vendor;
-        private String license;
-        private String location;
-        private boolean complete;
-        private boolean isFinal;
-
-        private final List<Bundle> bundles = new ArrayList<>();
-        private final List<Configuration> configurations = new ArrayList<>();
-        private final Map<String,String> variables = new HashMap<>();
-
-        public Builder(ArtifactID id) {
-            this.id = id;
-        }
-
-        public Builder(String groupId, String artifactId, String version) {
-            this(new ArtifactID(groupId, artifactId, version, null, null));
-        }
-
-        public Builder setTitle(String title) {
-            this.title = title;
-            return this;
-        }
-
-        public Builder setVendor(String vendor) {
-            this.vendor = vendor;
-            return this;
-        }
-
-        public Builder setLicense(String license) {
-            this.license = license;
-            return this;
-        }
-
-        public Builder setLocation(String location) {
-            this.location = location;
-            return this;
-        }
-
-        public Builder setComplete(boolean complete) {
-            this.complete = complete;
-            return this;
-        }
-
-        public Builder setFinal(boolean isFinal) {
-            this.isFinal = isFinal;
-            return this;
-        }
-
-        public Builder setDescription(String description) {
-            this.description = description;
-            return this;
-        }
-
-        public Builder addBundles(Bundle ... bundles) {
-            this.bundles.addAll(Arrays.asList(bundles));
-            return this;
-        }
-
-        public Builder addConfigurations(Configuration ... configs) {
-            this.configurations.addAll(Arrays.asList(configs));
-            return this;
-        }
-
-        public Builder addVariable(String key, String value) {
-            this.variables.put(key, value);
-            return this;
-        }
-
-        public Builder addVariables(Map<String, String> variables) {
-            this.variables.putAll(variables);
-            return this;
-        }
-
-        public Feature build() {
-            return new Feature(id, title,
-                    description, vendor, license, location, complete, isFinal,
-                    bundles, configurations, variables);
-        }
-    }
 }
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java b/osgi-featuremodel/src/main/java/org/osgi/feature/builder/ArtifactImpl.java
similarity index 80%
copy from osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
copy to osgi-featuremodel/src/main/java/org/osgi/feature/builder/ArtifactImpl.java
index 3a9085f..4eddc06 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/builder/ArtifactImpl.java
@@ -14,17 +14,21 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-package org.osgi.feature;
+package org.osgi.feature.builder;
+
+import org.osgi.feature.Artifact;
+import org.osgi.feature.ArtifactID;
 
 import java.util.Objects;
 
-public class Artifact {
+class ArtifactImpl implements Artifact {
     private final ArtifactID id;
 
-    protected Artifact(ArtifactID id) {
+    ArtifactImpl(ArtifactID id) {
         this.id = id;
     }
 
+    @Override
     public ArtifactID getID() {
         return id;
     }
@@ -38,9 +42,9 @@ public class Artifact {
     public boolean equals(Object obj) {
         if (this == obj)
             return true;
-        if (!(obj instanceof Artifact))
+        if (!(obj instanceof ArtifactImpl))
             return false;
-        Artifact other = (Artifact) obj;
+        ArtifactImpl other = (ArtifactImpl) obj;
         return Objects.equals(id, other.id);
     }
 }
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/builder/BundleBuilder.java b/osgi-featuremodel/src/main/java/org/osgi/feature/builder/BundleBuilder.java
new file mode 100644
index 0000000..3531d3d
--- /dev/null
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/builder/BundleBuilder.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.osgi.feature.builder;
+
+import org.osgi.feature.ArtifactID;
+import org.osgi.feature.Bundle;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public class BundleBuilder {
+    private final ArtifactID id;
+
+    private final Map<String,Object> metadata = new HashMap<>();
+
+    public BundleBuilder(ArtifactID id) {
+        this.id = id;
+    }
+
+    public BundleBuilder addMetadata(String key, Object value) {
+        this.metadata.put(key, value);
+        return this;
+    }
+
+    public BundleBuilder addMetadata(Map<String,Object> md) {
+        this.metadata.putAll(md);
+        return this;
+    }
+
+    public Bundle build() {
+        return new BundleImpl(id, metadata);
+    }
+
+    private static class BundleImpl extends ArtifactImpl implements Bundle {
+        private final Map<String, Object> metadata;
+
+        public BundleImpl(ArtifactID id, Map<String, Object> metadata) {
+            super(id);
+
+            this.metadata = Collections.unmodifiableMap(metadata);
+        }
+
+        @Override
+        public Map<String, Object> getMetadata() {
+            return metadata;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = super.hashCode();
+            result = prime * result + Objects.hash(metadata);
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (!super.equals(obj))
+                return false;
+            if (!(obj instanceof BundleImpl))
+                return false;
+            BundleImpl other = (BundleImpl) obj;
+            return Objects.equals(metadata, other.metadata);
+        }
+
+        @Override
+        public String toString() {
+            return "BundleImpl [metadata=" + metadata + ", getID()=" + getID() + "]";
+        }
+    }
+}
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/builder/FeatureBuilder.java b/osgi-featuremodel/src/main/java/org/osgi/feature/builder/FeatureBuilder.java
new file mode 100644
index 0000000..b37c76f
--- /dev/null
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/builder/FeatureBuilder.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.osgi.feature.builder;
+
+import org.osgi.feature.ArtifactID;
+import org.osgi.feature.Bundle;
+import org.osgi.feature.Configuration;
+import org.osgi.feature.Feature;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class FeatureBuilder {
+    private final ArtifactID id;
+
+    private String title;
+    private String description;
+    private String vendor;
+    private String license;
+    private String location;
+    private boolean complete;
+    private boolean isFinal;
+
+    private final List<Bundle> bundles = new ArrayList<>();
+    private final List<Configuration> configurations = new ArrayList<>();
+    private final Map<String,String> variables = new HashMap<>();
+
+    public FeatureBuilder(ArtifactID id) {
+        this.id = id;
+    }
+
+    public FeatureBuilder setTitle(String title) {
+        this.title = title;
+        return this;
+    }
+
+    public FeatureBuilder setVendor(String vendor) {
+        this.vendor = vendor;
+        return this;
+    }
+
+    public FeatureBuilder setLicense(String license) {
+        this.license = license;
+        return this;
+    }
+
+    public FeatureBuilder setLocation(String location) {
+        this.location = location;
+        return this;
+    }
+
+    public FeatureBuilder setComplete(boolean complete) {
+        this.complete = complete;
+        return this;
+    }
+
+    public FeatureBuilder setFinal(boolean isFinal) {
+        this.isFinal = isFinal;
+        return this;
+    }
+
+    public FeatureBuilder setDescription(String description) {
+        this.description = description;
+        return this;
+    }
+
+    public FeatureBuilder addBundles(Bundle ... bundles) {
+        this.bundles.addAll(Arrays.asList(bundles));
+        return this;
+    }
+
+    public FeatureBuilder addConfigurations(Configuration ... configs) {
+        this.configurations.addAll(Arrays.asList(configs));
+        return this;
+    }
+
+    public FeatureBuilder addVariable(String key, String value) {
+        this.variables.put(key, value);
+        return this;
+    }
+
+    public FeatureBuilder addVariables(Map<String, String> variables) {
+        this.variables.putAll(variables);
+        return this;
+    }
+
+    public Feature build() {
+        return new FeatureImpl(id, title,
+                description, vendor, license, location, complete, isFinal,
+                bundles, configurations, variables);
+    }
+
+    private static class FeatureImpl extends ArtifactImpl implements Feature {
+        private final String title;
+        private final String description;
+        private final String vendor;
+        private final String license;
+        private final String location;
+        private final boolean complete;
+        private final boolean isFinal;
+
+        private final List<Bundle> bundles;
+        private final List<Configuration> configurations;
+        private final Map<String, String> variables;
+
+        private FeatureImpl(ArtifactID id, String aTitle, String desc, String vnd, String lic, String loc,
+                boolean comp, boolean fin, List<Bundle> bs, List<Configuration> cs, Map<String,String> vars) {
+            super(id);
+
+            title = aTitle;
+            description = desc;
+            vendor = vnd;
+            license = lic;
+            location = loc;
+            complete = comp;
+            isFinal = fin;
+
+            bundles = Collections.unmodifiableList(bs);
+            configurations = Collections.unmodifiableList(cs);
+            variables = Collections.unmodifiableMap(vars);
+        }
+
+        @Override
+        public String getTitle() {
+            return title;
+        }
+
+        @Override
+        public String getDescription() {
+            return description;
+        }
+
+        @Override
+        public String getVendor() {
+            return vendor;
+        }
+
+        @Override
+        public String getLicense() {
+            return license;
+        }
+
+        @Override
+        public String getLocation() {
+            return location;
+        }
+
+        @Override
+        public boolean isComplete() {
+            return complete;
+        }
+
+        @Override
+        public boolean isFinal() {
+            return isFinal;
+        }
+
+        @Override
+        public List<Bundle> getBundles() {
+            return bundles;
+        }
+
+        @Override
+        public List<Configuration> getConfigurations() {
+            return configurations;
+        }
+
+        @Override
+        public Map<String, String> getVariables() {
+            return variables;
+        }
+    }
+}
diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/impl/FeatureServiceImpl.java b/osgi-featuremodel/src/main/java/org/osgi/feature/impl/FeatureServiceImpl.java
index e33bd0d..c30f308 100644
--- a/osgi-featuremodel/src/main/java/org/osgi/feature/impl/FeatureServiceImpl.java
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/impl/FeatureServiceImpl.java
@@ -19,9 +19,10 @@ package org.osgi.feature.impl;
 import org.osgi.feature.ArtifactID;
 import org.osgi.feature.Bundle;
 import org.osgi.feature.Feature;
-import org.osgi.feature.Feature.Builder;
 import org.osgi.feature.FeatureService;
 import org.osgi.feature.MergeContext;
+import org.osgi.feature.builder.BundleBuilder;
+import org.osgi.feature.builder.FeatureBuilder;
 
 import java.io.IOException;
 import java.io.Reader;
@@ -45,7 +46,7 @@ public class FeatureServiceImpl implements FeatureService {
         JsonObject json = Json.createReader(jsonReader).readObject();
 
         String id = json.getString("id");
-        Builder builder = new Feature.Builder(ArtifactID.fromMavenID(id));
+        FeatureBuilder builder = new FeatureBuilder(ArtifactID.fromMavenID(id));
 
         builder.setTitle(json.getString("title", null));
         builder.setDescription(json.getString("description", null));
@@ -69,7 +70,7 @@ public class FeatureServiceImpl implements FeatureService {
             if (val.getValueType() == JsonValue.ValueType.OBJECT) {
                 JsonObject jo = val.asJsonObject();
                 String bid = jo.getString("id");
-                Bundle.Builder bbuilder = new Bundle.Builder(ArtifactID.fromMavenID(bid));
+                BundleBuilder bbuilder = new BundleBuilder(ArtifactID.fromMavenID(bid));
 
                 for (Map.Entry<String, JsonValue> entry : jo.entrySet()) {
                     if (entry.getKey().equals("id"))
@@ -106,7 +107,7 @@ public class FeatureServiceImpl implements FeatureService {
     @Override
     public Feature mergeFeatures(ArtifactID targetID, Feature f1, Feature f2, MergeContext ctx) {
 
-        Builder fb = new Feature.Builder(targetID);
+        FeatureBuilder fb = new FeatureBuilder(targetID);
 
         copyAttrs(f1, fb);
         copyAttrs(f2, fb);
@@ -143,7 +144,7 @@ public class FeatureServiceImpl implements FeatureService {
         return bundles;
     }
 
-    private void copyAttrs(Feature f, Builder fb) {
+    private void copyAttrs(Feature f, FeatureBuilder fb) {
         fb.setTitle(f.getTitle());
         fb.setDescription(f.getDescription());
         fb.setVendor(f.getVendor());
diff --git a/osgi-featuremodel/src/test/java/org/osgi/feature/impl/FeatureServiceImplTest.java b/osgi-featuremodel/src/test/java/org/osgi/feature/impl/FeatureServiceImplTest.java
index 4b7ed7e..a18a132 100644
--- a/osgi-featuremodel/src/test/java/org/osgi/feature/impl/FeatureServiceImplTest.java
+++ b/osgi-featuremodel/src/test/java/org/osgi/feature/impl/FeatureServiceImplTest.java
@@ -22,6 +22,7 @@ import org.osgi.feature.Bundle;
 import org.osgi.feature.Feature;
 import org.osgi.feature.FeatureService;
 import org.osgi.feature.MergeContext;
+import org.osgi.feature.builder.BundleBuilder;
 import org.osgi.feature.builder.MergeContextBuilder;
 
 import java.io.IOException;
@@ -50,7 +51,7 @@ public class FeatureServiceImplTest {
             List<Bundle> bundles = f.getBundles();
             assertEquals(3, bundles.size());
 
-            Bundle bundle = new Bundle.Builder("org.osgi", "osgi.promise", "7.0.1")
+            Bundle bundle = new BundleBuilder(new ArtifactID("org.osgi", "osgi.promise", "7.0.1"))
                     .addMetadata("hash", "4632463464363646436")
                     .addMetadata("start-order", 1L)
                     .build();
@@ -59,8 +60,8 @@ public class FeatureServiceImplTest {
             ba.equals(bundle);
 
             assertTrue(bundles.contains(bundle));
-            assertTrue(bundles.contains(new Bundle.Builder("org.slf4j", "slf4j-api", "1.7.29").build()));
-            assertTrue(bundles.contains(new Bundle.Builder("org.slf4j", "slf4j-simple", "1.7.29").build()));
+            assertTrue(bundles.contains(new BundleBuilder(new ArtifactID("org.slf4j", "slf4j-api", "1.7.29")).build()));
+            assertTrue(bundles.contains(new BundleBuilder(new ArtifactID("org.slf4j", "slf4j-simple", "1.7.29")).build()));
         }
     }
 
@@ -90,7 +91,7 @@ public class FeatureServiceImplTest {
         List<Bundle> bundles = f3.getBundles();
         assertEquals(4, bundles.size());
 
-        assertTrue(bundles.contains(new Bundle.Builder("org.slf4j", "slf4j-api", "1.7.29").build()));
-        assertTrue(bundles.contains(new Bundle.Builder("org.slf4j", "slf4j-api", "1.7.30").build()));
+        assertTrue(bundles.contains(new BundleBuilder(new ArtifactID("org.slf4j", "slf4j-api", "1.7.29")).build()));
+        assertTrue(bundles.contains(new BundleBuilder(new ArtifactID("org.slf4j", "slf4j-api", "1.7.30")).build()));
     }
 }