diff --git a/integrations/oci/tls-certificates/pom.xml b/integrations/oci/tls-certificates/pom.xml
index 6e584f9932a..4e8dd495662 100644
--- a/integrations/oci/tls-certificates/pom.xml
+++ b/integrations/oci/tls-certificates/pom.xml
@@ -182,7 +182,6 @@
SETME
SETME
SETME
-
false
diff --git a/integrations/oci/tls-certificates/src/test/java/io/helidon/integrations/oci/tls/certificates/OciCertificatesTlsManagerTest.java b/integrations/oci/tls-certificates/src/test/java/io/helidon/integrations/oci/tls/certificates/OciCertificatesTlsManagerTest.java
index 88ee911e7c7..7ca9df86b2e 100644
--- a/integrations/oci/tls-certificates/src/test/java/io/helidon/integrations/oci/tls/certificates/OciCertificatesTlsManagerTest.java
+++ b/integrations/oci/tls-certificates/src/test/java/io/helidon/integrations/oci/tls/certificates/OciCertificatesTlsManagerTest.java
@@ -74,7 +74,7 @@ void configIsMonitoredForChange() throws Exception {
assertThat("sanity",
caCertDownloadCountBaseline0,
equalTo(0));
- assertThat("santiy",
+ assertThat("sanity",
pkDownloadCountBaseLine0,
equalTo(0));
diff --git a/service/registry/src/main/java/io/helidon/service/registry/ServiceSupplies.java b/service/registry/src/main/java/io/helidon/service/registry/ServiceSupplies.java
index a34521f81c1..94e58e29724 100644
--- a/service/registry/src/main/java/io/helidon/service/registry/ServiceSupplies.java
+++ b/service/registry/src/main/java/io/helidon/service/registry/ServiceSupplies.java
@@ -33,6 +33,29 @@ final class ServiceSupplies {
private ServiceSupplies() {
}
+ private static Optional> oneInstance(Lookup lookup,
+ List> serviceManagers) {
+ // we may have more than one service manager, as the first one(s) may not provide a value
+ traceLookup(lookup, "explode, filter, and sort");
+
+ for (ServiceManager serviceManager : serviceManagers) {
+ Optional> thisManager = serviceManager.activator()
+ .instances(lookup)
+ .stream()
+ .flatMap(List::stream)
+ .map(it -> serviceManager.registryInstance(lookup, it))
+ .findFirst();
+
+ traceLookupInstance(lookup, serviceManager, thisManager.map(List::of).orElseGet(List::of));
+
+ if (thisManager.isPresent()) {
+ return thisManager;
+ }
+ }
+
+ return Optional.empty();
+ }
+
private static List> explodeFilterAndSort(Lookup lookup,
List> serviceManagers) {
// this method is called when we resolve instances, so we can safely assume any scope is active
@@ -133,9 +156,7 @@ static class ServiceSupply extends ServiceSupplyBase implements Supplier supplier;
- supplier = () -> explodeFilterAndSort(lookup, managers)
- .stream()
- .findFirst()
+ supplier = () -> oneInstance(lookup, managers)
.map(ServiceInstance::get)
.orElseThrow(() -> new ServiceRegistryException(
"Neither of matching services could provide a value. Descriptors: " + managers + ", "
@@ -158,9 +179,7 @@ static class ServiceSupplyOptional extends ServiceSupplyBase implements Su
@Override
public Optional get() {
- Optional> first = explodeFilterAndSort(super.lookup, super.managers)
- .stream()
- .findFirst();
+ Optional> first = oneInstance(super.lookup, super.managers);
return first.map(Supplier::get);
}
}
@@ -173,9 +192,7 @@ static class ServiceInstanceSupplyOptional extends ServiceSupplyBase imple
@Override
public Optional> get() {
- return explodeFilterAndSort(super.lookup, super.managers)
- .stream()
- .findFirst();
+ return oneInstance(super.lookup, super.managers);
}
}