-
Notifications
You must be signed in to change notification settings - Fork 31
Release 0.2.4 #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release 0.2.4 #87
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update the <revision> property in pom.xml to prepare for the next development iteration.
Introduced constants for SimpleReactiveDiscoveryClientAutoConfiguration and ReactiveCompositeDiscoveryClientAutoConfiguration class names in DiscoveryClientConstants. This improves maintainability and consistency when referencing these class names.
Added assertions for SIMPLE_REACTIVE_DISCOVERY_CLIENT_AUTO_CONFIGURATION_CLASS_NAME and REACTIVE_COMPOSITE_DISCOVERY_CLIENT_AUTO_CONFIGURATION_CLASS_NAME in DiscoveryClientConstantsTest to improve test coverage for recently introduced constants.
Annotated ReactiveDiscoveryClientAutoConfiguration with @AutoConfigureAfter to ensure it is configured after SimpleReactiveDiscoveryClientAutoConfiguration and ReactiveCompositeDiscoveryClientAutoConfiguration. This improves the ordering of auto-configuration classes.
Introduces DiscoveryUtils, a utility class providing helper methods for working with SimpleDiscoveryProperties and SimpleReactiveDiscoveryProperties in Spring Cloud. Includes methods for retrieving instance maps and converting between the two property types.
Introduces DiscoveryUtilsTest to verify the behavior of DiscoveryUtils methods, including getInstancesMap and simpleDiscoveryProperties, using both SimpleDiscoveryProperties and SimpleReactiveDiscoveryProperties.
Extended SimpleServiceRegistry to support both SimpleDiscoveryProperties and SimpleReactiveDiscoveryProperties by overloading constructors and using a utility method to obtain the instances map. This enhances compatibility with reactive discovery configurations.
Introduces a test for the SimpleServiceRegistry constructor that accepts SimpleReactiveDiscoveryProperties. Also refactors testGetStatus to use testSetStatus for improved clarity.
Introduced a utility method to copy properties from a ServiceInstance to a DefaultServiceInstance, streamlining property assignment between these types.
Introduced a new unit test to verify the setProperties method, ensuring that properties are correctly copied between service instances.
Updated ServiceInstanceUtils.setProperties to set the URI on the target DefaultServiceInstance using getUri(source) instead of setting host, port, and secure individually.
Added property copying for DefaultServiceInstance when converting SimpleDiscoveryProperties to SimpleReactiveDiscoveryProperties using setProperties. Also added @nonnull annotations to method parameters for better null safety.
Update ServiceInstanceUtils to use port 443 for secure instances and 80 for non-secure instances when the provided port is less than or equal to zero. This ensures generated URLs are always valid even if the ServiceInstance port is not set.
Added test cases to verify getUriString and getUri methods handle URIs without explicit ports, ensuring default ports (80 for HTTP, 443 for HTTPS) are appended as expected.
Replaces setting URI on target with setting secure, host, and port properties from the source ServiceInstance. This change ensures that DefaultServiceInstance receives these individual properties directly.
Cleaned up formatting by deleting an extra blank line in the getUriString test method.
Introduced LOAD_BALANCER_ENABLED_PROPERTY_NAME to represent the 'spring.cloud.loadbalancer.enabled' property, including relevant documentation and configuration property annotation.
Introduces SpringCloudPropertyConstantsTest to verify the values of property name constants in SpringCloudPropertyConstants.
Introduces a custom annotation that meta-annotates @ConditionalOnProperty for enabling LoadBalancer features based on the 'loadbalancer.enabled' property. This simplifies conditional bean registration for LoadBalancer-related components.
Introduces a unit test to verify the behavior of the @ConditionalOnLoadBalancerEnabled annotation, ensuring the Config bean is conditionally present based on the 'spring.cloud.loadbalancer.enabled' property.
Introduced UTIL_ENABLED_PROPERTY_NAME for enabling or disabling Spring Cloud Util via the 'spring.cloud.util.enabled' property. This addition aligns with the existing pattern for feature toggles and references UtilAutoConfiguration.
Added an assertion to verify the value of UTIL_ENABLED_PROPERTY_NAME in SpringCloudPropertyConstantsTest to ensure the constant is correctly defined.
Moved the @ConditionalOnLoadBalancerEnabled annotation from the inner Config class to the test class itself. Updated testConfigBean to reference the test class instead of the inner Config class, simplifying the test structure.
Introduces a custom annotation that meta-annotates @ConditionalOnProperty for UtilAutoConfiguration, enabling conditional configuration based on the UTIL_ENABLED_PROPERTY_NAME property.
Introduces ConditionalOnUtilEnabledTest to verify bean presence based on the 'spring.cloud.util.enabled' property. Ensures correct conditional behavior in Spring container.
Replaces usage of getClass() with explicit test class references in ConditionalOnUtilEnabledTest and ConditionalOnLoadBalancerEnabledTest to ensure correct bean presence checks.
Replaced imports of isBeanPresent from com.alibaba.spring.util.BeanUtils with io.microsphere.spring.beans.BeanUtils in ConditionalOnUtilEnabledTest and ConditionalOnLoadBalancerEnabledTest to reflect package changes.
Introduced ConditionalOnPropertyEnabledTest as a reusable abstract test class for @ConditionalOnProperty-based conditions. Updated ConditionalOnFeaturesEnabledTest, ConditionalOnUtilEnabledTest, and ConditionalOnLoadBalancerEnabledTest to extend this new base class, reducing code duplication and improving maintainability. Also set matchIfMissing=true for ConditionalOnFeaturesEnabled.
Eliminated the matchIfMissing attribute and its related @AliasFor usage from the ConditionalOnFeaturesEnabled annotation, simplifying the annotation as the property is already set via @ConditionalOnProperty.
Introduced test cases to verify the toList utility method in ReactiveDiscoveryClientAdapter using different schedulers. Ensures correct conversion of Flux to List under various scheduling scenarios.
Release 0.2.4
Update README.md
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



This pull request introduces several improvements and enhancements to the Spring Cloud Commons integration, focusing on better support for reactive discovery, utility methods, and configuration flexibility. The most important changes include new utility classes for discovery properties, expanded support for both simple and reactive discovery properties in the service registry, and improved auto-configuration ordering for reactive discovery clients.
Spring Cloud Discovery Enhancements:
DiscoveryUtilsutility class to simplify conversions and instance retrieval betweenSimpleDiscoveryPropertiesandSimpleReactiveDiscoveryProperties.SimpleServiceRegistryto support bothSimpleDiscoveryPropertiesandSimpleReactiveDiscoveryProperties, allowing for more flexible service registration. [1] [2]Reactive Discovery Client Improvements:
ReactiveDiscoveryClientAutoConfigurationto use@AutoConfigureAfterfor better ordering with related auto-configuration classes, and updated constants accordingly. [1] [2] [3] [4] [5]ReactiveDiscoveryClientAdapterto avoid blocking in non-blocking threads, increasing compatibility with reactive environments. [1] [2]Configuration and Utility Updates:
ConditionalOnUtilEnabledannotation for conditional configuration based on theUtilAutoConfigurationproperty. [1] [2]ConditionalOnFeaturesEnabledto always match if the property is missing, simplifying its usage. [1] [2]Other Notable Changes:
getUriStringutility to handle default ports when not specified, and added a newsetPropertieshelper forServiceInstancecopying. [1] [2] [3]