GH-2303 - Upgrade to Spring Plugin 4.0 snapshots.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -84,7 +84,7 @@
|
||||
<reactor-bom.version>2024.0.5</reactor-bom.version>
|
||||
<slf4j.version>2.0.17</slf4j.version>
|
||||
<spring.version>7.0.0-M2</spring.version>
|
||||
<spring-plugin.version>3.0.0</spring-plugin.version>
|
||||
<spring-plugin.version>4.0.0-SNAPSHOT</spring-plugin.version>
|
||||
<kotlin.version>2.1.0</kotlin.version>
|
||||
<kotlinx-coroutines.version>1.10.1</kotlinx-coroutines.version>
|
||||
<mockk.version>1.14.0</mockk.version>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.hateoas.config;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
@@ -35,13 +35,12 @@ import org.springframework.plugin.core.support.PluginRegistryFactoryBean;
|
||||
class EntityLinksConfiguration {
|
||||
|
||||
@Bean
|
||||
OrderAwarePluginRegistry<EntityLinks, Class<?>> entityLinksPluginRegistry(ApplicationContext context) {
|
||||
OrderAwarePluginRegistry<EntityLinks, Class<?>> entityLinksPluginRegistry(ListableBeanFactory beanFactory) {
|
||||
|
||||
PluginRegistryFactoryBean<EntityLinks, Class<?>> registry = new PluginRegistryFactoryBean<>();
|
||||
registry.setApplicationContext(context);
|
||||
registry.setBeanFactory(beanFactory);
|
||||
registry.setType(EntityLinks.class);
|
||||
registry.setExclusions(new Class[] { DelegatingEntityLinks.class });
|
||||
registry.afterPropertiesSet();
|
||||
|
||||
return registry.getObject();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.PropertiesFactoryBean;
|
||||
@@ -107,13 +108,13 @@ public class HateoasConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
OrderAwarePluginRegistry<LinkRelationProvider, LookupContext> relProviderPluginRegistry(ApplicationContext context) {
|
||||
OrderAwarePluginRegistry<LinkRelationProvider, LookupContext> relProviderPluginRegistry(
|
||||
ListableBeanFactory beanFactory) {
|
||||
|
||||
PluginRegistryFactoryBean<LinkRelationProvider, LookupContext> factory = new PluginRegistryFactoryBean<>();
|
||||
factory.setApplicationContext(context);
|
||||
factory.setBeanFactory(beanFactory);
|
||||
factory.setType(LinkRelationProvider.class);
|
||||
factory.setExclusions(new Class[] { DelegatingLinkRelationProvider.class });
|
||||
factory.afterPropertiesSet();
|
||||
|
||||
return factory.getObject();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.hateoas.TestUtils;
|
||||
import org.springframework.hateoas.server.EntityLinks;
|
||||
import org.springframework.hateoas.server.ExposesResourceFor;
|
||||
import org.springframework.plugin.core.SimplePluginRegistry;
|
||||
import org.springframework.plugin.core.OrderAwarePluginRegistry;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ class DelegatingEntityLinksUnitTest extends TestUtils {
|
||||
@Test
|
||||
void throwsExceptionForUnsupportedClass() {
|
||||
|
||||
EntityLinks links = new DelegatingEntityLinks(SimplePluginRegistry.empty());
|
||||
EntityLinks links = new DelegatingEntityLinks(OrderAwarePluginRegistry.empty());
|
||||
|
||||
assertThatExceptionOfType(IllegalArgumentException.class) //
|
||||
.isThrownBy(() -> links.linkFor(String.class)) //
|
||||
@@ -84,7 +84,7 @@ class DelegatingEntityLinksUnitTest extends TestUtils {
|
||||
}
|
||||
|
||||
private EntityLinks createDelegatingEntityLinks(EntityLinks target) {
|
||||
return new DelegatingEntityLinks(SimplePluginRegistry.of(target));
|
||||
return new DelegatingEntityLinks(OrderAwarePluginRegistry.of(target));
|
||||
}
|
||||
|
||||
@ExposesResourceFor(String.class)
|
||||
|
||||
Reference in New Issue
Block a user