Repository: smallrye/smallrye-stork
Pull request #501 (2023-02-20 07:32:35)

fix imposrt issue
- Update the smallrye parent which update the impsort plugin
- Re-apply formatter after the plugin update.



Patch:
diff --git a/api/src/main/java/io/smallrye/stork/api/LoadBalancer.java b/api/src/main/java/io/smallrye/stork/api/LoadBalancer.java
index 60573c82..cb0c8cbc 100644
--- a/api/src/main/java/io/smallrye/stork/api/LoadBalancer.java
+++ b/api/src/main/java/io/smallrye/stork/api/LoadBalancer.java
@@ -14,7 +14,7 @@ public interface LoadBalancer {
      * Select a single {@link ServiceInstance} from the given list.
      *
      * @param serviceInstances instances to choose from
-     * 
+     *
      * @return a ServiceInstance
      *
      * @throws NoServiceInstanceFoundException if the incoming collection is empty or all the service instances in the
diff --git a/api/src/main/java/io/smallrye/stork/api/NoServiceInstanceFoundException.java b/api/src/main/java/io/smallrye/stork/api/NoServiceInstanceFoundException.java
index 0a650782..fcc20a00 100644
--- a/api/src/main/java/io/smallrye/stork/api/NoServiceInstanceFoundException.java
+++ b/api/src/main/java/io/smallrye/stork/api/NoServiceInstanceFoundException.java
@@ -8,7 +8,7 @@ public class NoServiceInstanceFoundException extends RuntimeException {
 
     /**
      * Creates a new NoServiceInstanceFoundException.
-     * 
+     *
      * @param message the error message
      */
     public NoServiceInstanceFoundException(String message) {
diff --git a/api/src/main/java/io/smallrye/stork/api/config/ConfigWithType.java b/api/src/main/java/io/smallrye/stork/api/config/ConfigWithType.java
index 1bdd8479..9bb6a259 100644
--- a/api/src/main/java/io/smallrye/stork/api/config/ConfigWithType.java
+++ b/api/src/main/java/io/smallrye/stork/api/config/ConfigWithType.java
@@ -18,7 +18,7 @@ public interface ConfigWithType {
 
     /**
      * Load Balancer parameters.
-     * 
+     *
      * @return map of parameters of the load balancer
      */
     Map<String, String> parameters();
diff --git a/api/src/main/java/io/smallrye/stork/api/config/LoadBalancerAttribute.java b/api/src/main/java/io/smallrye/stork/api/config/LoadBalancerAttribute.java
index d871676d..d853b080 100644
--- a/api/src/main/java/io/smallrye/stork/api/config/LoadBalancerAttribute.java
+++ b/api/src/main/java/io/smallrye/stork/api/config/LoadBalancerAttribute.java
@@ -30,21 +30,21 @@ public @interface LoadBalancerAttribute {
 
     /**
      * Default value for the attribute. If not provided and user didn't set the value - null will be passed
-     * 
+     *
      * @return the default value
      */
     String defaultValue() default Constants.DEFAULT_VALUE;
 
     /**
      * Description of the attribute. Works best in the documentation if it starts with a capital letter and ends with period.
-     * 
+     *
      * @return the description
      */
     String description();
 
     /**
      * Whether the attribute is mandatory or optional
-     * 
+     *
      * @return true if the attribute is required, false otherwise
      */
     boolean required() default false;
diff --git a/api/src/main/java/io/smallrye/stork/api/config/ServiceConfig.java b/api/src/main/java/io/smallrye/stork/api/config/ServiceConfig.java
index 7b012184..a4b53c4e 100644
--- a/api/src/main/java/io/smallrye/stork/api/config/ServiceConfig.java
+++ b/api/src/main/java/io/smallrye/stork/api/config/ServiceConfig.java
@@ -20,14 +20,14 @@ public interface ServiceConfig {
 
     /**
      * ServiceDiscovery configuration for the service
-     * 
+     *
      * @return (required) service discovery configuration
      */
     ConfigWithType serviceDiscovery();
 
     /**
      * Whether the communication should use a secure connection (e.g. HTTPS)
-     * 
+     *
      * @return true if SSL, TLS, etc. should be used for the communication
      * @deprecated Use the service discovery 'secure' attribute instead
      */
diff --git a/api/src/main/java/io/smallrye/stork/api/config/ServiceDiscoveryAttribute.java b/api/src/main/java/io/smallrye/stork/api/config/ServiceDiscoveryAttribute.java
index 1c92df1e..fc26b455 100644
--- a/api/src/main/java/io/smallrye/stork/api/config/ServiceDiscoveryAttribute.java
+++ b/api/src/main/java/io/smallrye/stork/api/config/ServiceDiscoveryAttribute.java
@@ -31,21 +31,21 @@ public @interface ServiceDiscoveryAttribute {
 
     /**
      * Default value for the attribute. If not provided and user didn't set the value - null will be passed
-     * 
+     *
      * @return the default value
      */
     String defaultValue() default Constants.DEFAULT_VALUE;
 
     /**
      * Description of the attribute. Works best in the documentation if it starts with a capital letter and ends with period.
-     * 
+     *
      * @return the description
      */
     String description();
 
     /**
      * Whether the attribute is mandatory or optional
-     * 
+     *
      * @return true if the attribute is required, false otherwise
      */
     boolean required() default false;
diff --git a/api/src/main/java/io/smallrye/stork/api/config/ServiceRegistrarAttribute.java b/api/src/main/java/io/smallrye/stork/api/config/ServiceRegistrarAttribute.java
index 8a6e14bf..1333d2a8 100644
--- a/api/src/main/java/io/smallrye/stork/api/config/ServiceRegistrarAttribute.java
+++ b/api/src/main/java/io/smallrye/stork/api/config/ServiceRegistrarAttribute.java
@@ -31,21 +31,21 @@ public @interface ServiceRegistrarAttribute {
 
     /**
      * Default value for the attribute. If not provided and user didn't set the value - null will be passed
-     * 
+     *
      * @return the default value
      */
     String defaultValue() default Constants.DEFAULT_VALUE;
 
     /**
      * Description of the attribute. Works best in the documentation if it starts with a capital letter and ends with period.
-     * 
+     *
      * @return the description
      */
     String description();
 
     /**
      * Whether the attribute is mandatory or optional
-     * 
+     *
      * @return true if the attribute is required, false otherwise
      */
     boolean required() default false;
diff --git a/api/src/main/java/io/smallrye/stork/spi/ElementWithType.java b/api/src/main/java/io/smallrye/stork/spi/ElementWithType.java
index 9058baf5..f4eb12ee 100644
--- a/api/src/main/java/io/smallrye/stork/spi/ElementWithType.java
+++ b/api/src/main/java/io/smallrye/stork/spi/ElementWithType.java
@@ -6,7 +6,7 @@ package io.smallrye.stork.spi;
 public interface ElementWithType {
     /**
      * Gets the type.
-     * 
+     *
      * @return the type, must not be {@code null}, must not be blank
      */
     String type();
diff --git a/api/src/main/java/io/smallrye/stork/spi/StorkInfrastructure.java b/api/src/main/java/io/smallrye/stork/spi/StorkInfrastructure.java
index 9f67773a..b7c36c2b 100644
--- a/api/src/main/java/io/smallrye/stork/spi/StorkInfrastructure.java
+++ b/api/src/main/java/io/smallrye/stork/spi/StorkInfrastructure.java
@@ -4,16 +4,16 @@ import java.util.function.Supplier;
 
 /**
  * A provider for "utility" objects used by service discovery and load balancer implementations.
- * 
+ *
  * The default implementation, {@code DefaultStorkInfrastructure} provides objects created by the passed supplier.
  * Vendors can implement their own version of this class to provide custom objects.
- * 
+ *
  * E.g. Quarkus uses a single Vert.x instance throughout the project and overrides this to return this Vert.x instance
  */
 public interface StorkInfrastructure {
     /**
      * Get an instance of a "utility" class
-     * 
+     *
      * @param utilityClass class of the requested object
      * @param defaultSupplier should be used by the implementation to create an object if the environment doesn't provide one,
      *        the result value can be cached.
diff --git a/core/src/main/java/io/smallrye/stork/impl/CachingServiceDiscovery.java b/core/src/main/java/io/smallrye/stork/impl/CachingServiceDiscovery.java
index d63216ac..3d3bc92b 100644
--- a/core/src/main/java/io/smallrye/stork/impl/CachingServiceDiscovery.java
+++ b/core/src/main/java/io/smallrye/stork/impl/CachingServiceDiscovery.java
@@ -52,7 +52,7 @@ public abstract class CachingServiceDiscovery implements ServiceDiscovery {
     /***
      * Configures the period to keep service instances in the cache. Elements will be refetched after the given period.
      * This method can be extended by the provider in order to change the logic for caching service instances.
-     * 
+     *
      * @param uni service instances retrieved from backing discovery source
      * @return cached list of service instances in form of Uni
      */
diff --git a/load-balancer/sticky/src/main/java/io/smallrye/stork/loadbalancer/random/StickyLoadBalancer.java b/load-balancer/sticky/src/main/java/io/smallrye/stork/loadbalancer/random/StickyLoadBalancer.java
index c40097a0..f4c1bb29 100644
--- a/load-balancer/sticky/src/main/java/io/smallrye/stork/loadbalancer/random/StickyLoadBalancer.java
+++ b/load-balancer/sticky/src/main/java/io/smallrye/stork/loadbalancer/random/StickyLoadBalancer.java
@@ -50,7 +50,7 @@ public class StickyLoadBalancer implements LoadBalancer, CallStatisticsCollector
 
     /**
      * Selects the service instance
-     * 
+     *
      * @param serviceInstances instances to choose from
      *
      * @return the selected instance
diff --git a/pom.xml b/pom.xml
index be159522..d8e1d675 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,8 +19,8 @@
 
     <parent>
         <groupId>io.smallrye</groupId>
-        <artifactId>smallrye-jakarta-parent</artifactId>
-        <version>38</version>
+        <artifactId>smallrye-parent</artifactId>
+        <version>39</version>
     </parent>
 
     <groupId>io.smallrye.stork</groupId>
diff --git a/service-discovery/composite/src/main/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscovery.java b/service-discovery/composite/src/main/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscovery.java
index d2827927..8bdc9778 100644
--- a/service-discovery/composite/src/main/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscovery.java
+++ b/service-discovery/composite/src/main/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscovery.java
@@ -27,7 +27,7 @@ public class CompositeServiceDiscovery implements ServiceDiscovery {
 
     /**
      * Creates a new CompositeServiceDiscovery
-     * 
+     *
      * @param serviceName the service name
      * @param serviceNames the composed service names
      */
diff --git a/service-discovery/consul/src/main/java/io/smallrye/stork/servicediscovery/consul/ConsulMetadataKey.java b/service-discovery/consul/src/main/java/io/smallrye/stork/servicediscovery/consul/ConsulMetadataKey.java
index 95314cb4..b003d63a 100644
--- a/service-discovery/consul/src/main/java/io/smallrye/stork/servicediscovery/consul/ConsulMetadataKey.java
+++ b/service-discovery/consul/src/main/java/io/smallrye/stork/servicediscovery/consul/ConsulMetadataKey.java
@@ -24,7 +24,7 @@ public enum ConsulMetadataKey implements MetadataKey {
 
     /**
      * Creates a new ConsulMetadataKey
-     * 
+     *
      * @param name the name
      */
     ConsulMetadataKey(String name) {
diff --git a/service-discovery/dns/src/main/java/io/smallrye/stork/servicediscovery/dns/DnsMetadataKey.java b/service-discovery/dns/src/main/java/io/smallrye/stork/servicediscovery/dns/DnsMetadataKey.java
index be955a45..690e7019 100644
--- a/service-discovery/dns/src/main/java/io/smallrye/stork/servicediscovery/dns/DnsMetadataKey.java
+++ b/service-discovery/dns/src/main/java/io/smallrye/stork/servicediscovery/dns/DnsMetadataKey.java
@@ -21,7 +21,7 @@ public enum DnsMetadataKey implements MetadataKey {
 
     /**
      * Creates a new DnsMetadataKey
-     * 
+     *
      * @param name the name
      */
     DnsMetadataKey(String name) {
diff --git a/service-discovery/eureka/src/main/java/io/smallrye/stork/servicediscovery/eureka/EurekaMetadataKey.java b/service-discovery/eureka/src/main/java/io/smallrye/stork/servicediscovery/eureka/EurekaMetadataKey.java
index 5cc089a4..9912208f 100644
--- a/service-discovery/eureka/src/main/java/io/smallrye/stork/servicediscovery/eureka/EurekaMetadataKey.java
+++ b/service-discovery/eureka/src/main/java/io/smallrye/stork/servicediscovery/eureka/EurekaMetadataKey.java
@@ -16,7 +16,7 @@ public enum EurekaMetadataKey implements MetadataKey {
 
     /**
      * Creates a new ConsulMetadataKey
-     * 
+     *
      * @param name the name
      */
     EurekaMetadataKey(String name) {


Test patch:
diff --git a/core/src/test/java/io/smallrye/stork/ProgrammaticApiTest.java b/core/src/test/java/io/smallrye/stork/ProgrammaticApiTest.java
index e8a817bb..7f62ff56 100644
--- a/core/src/test/java/io/smallrye/stork/ProgrammaticApiTest.java
+++ b/core/src/test/java/io/smallrye/stork/ProgrammaticApiTest.java
@@ -83,7 +83,7 @@ public class ProgrammaticApiTest {
         Stork.initialize();
         assertThatThrownBy(() -> Stork.getInstance().defineIfAbsent(null,
                 ServiceDefinition.of(new FakeConfiguration().withSecure("true"), new SingleConfiguration())))
-                        .isInstanceOf(IllegalArgumentException.class);
+                .isInstanceOf(IllegalArgumentException.class);
 
         assertThatThrownBy(() -> Stork.getInstance().defineIfAbsent("acme",
                 ServiceDefinition.of(null, new SingleConfiguration()))).isInstanceOf(IllegalArgumentException.class);
diff --git a/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryCDITest.java b/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryCDITest.java
index 50e2663d..d99b6d08 100644
--- a/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryCDITest.java
+++ b/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryCDITest.java
@@ -129,7 +129,7 @@ public class CompositeServiceDiscoveryCDITest {
         assertThatThrownBy(() -> stork.getService("third-service")
                 .getInstances()
                 .await().atMost(Duration.ofSeconds(5))).isInstanceOf(NoSuchServiceDefinitionException.class)
-                        .hasMessageContaining("second-service");
+                .hasMessageContaining("second-service");
 
         stork.defineIfAbsent("second-service",
                 ServiceDefinition.of(new StaticConfiguration().withAddressList("localhost:8082")));
diff --git a/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryTest.java b/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryTest.java
index 49435908..3e469dfa 100644
--- a/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryTest.java
+++ b/service-discovery/composite/src/test/java/io/smallrye/stork/servicediscovery/composite/CompositeServiceDiscoveryTest.java
@@ -115,7 +115,7 @@ public class CompositeServiceDiscoveryTest {
         assertThatThrownBy(() -> stork.getService("third-service")
                 .getInstances()
                 .await().atMost(Duration.ofSeconds(5))).isInstanceOf(NoSuchServiceDefinitionException.class)
-                        .hasMessageContaining("second-service");
+                .hasMessageContaining("second-service");
 
         stork.defineIfAbsent("second-service",
                 ServiceDefinition.of(new StaticConfiguration().withAddressList("localhost:8082")));
diff --git a/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiCDITest.java b/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiCDITest.java
index fc5f81f9..45314576 100644
--- a/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiCDITest.java
+++ b/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiCDITest.java
@@ -114,8 +114,9 @@ public class StaticListServiceDiscoveryProgrammaticApiCDITest {
     void shouldFailOnInvalidFormat() {
         assertThatThrownBy(() -> stork.defineIfAbsent("broken-service", ServiceDefinition.of(
                 new StaticConfiguration()
-                        .withAddressList("localhost:8080, localhost:8081, , ")))).isInstanceOf(IllegalArgumentException.class)
-                                .hasMessageContaining("Address not parseable");
+                        .withAddressList("localhost:8080, localhost:8081, , "))))
+                .isInstanceOf(IllegalArgumentException.class)
+                .hasMessageContaining("Address not parseable");
     }
 
 }
diff --git a/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiTest.java b/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiTest.java
index 99543ee5..64b6ace9 100644
--- a/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiTest.java
+++ b/service-discovery/static-list/src/test/java/io/smallrye/stork/servicediscovery/staticlist/StaticListServiceDiscoveryProgrammaticApiTest.java
@@ -100,8 +100,9 @@ public class StaticListServiceDiscoveryProgrammaticApiTest {
     void shouldFailOnInvalidFormat() {
         assertThatThrownBy(() -> stork.defineIfAbsent("broken-service", ServiceDefinition.of(
                 new StaticConfiguration()
-                        .withAddressList("localhost:8080, localhost:8081, , ")))).isInstanceOf(IllegalArgumentException.class)
-                                .hasMessageContaining("Address not parseable");
+                        .withAddressList("localhost:8080, localhost:8081, , "))))
+                .isInstanceOf(IllegalArgumentException.class)
+                .hasMessageContaining("Address not parseable");
     }
 
 }