File tree 4 files changed +11
-11
lines changed
main/java/org/springframework/hateoas/config
test/java/org/springframework/hateoas/server/core
4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 84
84
<reactor-bom .version>2024.0.5</reactor-bom .version>
85
85
<slf4j .version>2.0.17</slf4j .version>
86
86
<spring .version>7.0.0-M2</spring .version>
87
- <spring-plugin .version>3 .0.0</spring-plugin .version>
87
+ <spring-plugin .version>4 .0.0-SNAPSHOT </spring-plugin .version>
88
88
<kotlin .version>2.1.0</kotlin .version>
89
89
<kotlinx-coroutines .version>1.10.1</kotlinx-coroutines .version>
90
90
<mockk .version>1.14.0</mockk .version>
Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .springframework .hateoas .config ;
17
17
18
- import org .springframework .context . ApplicationContext ;
18
+ import org .springframework .beans . factory . ListableBeanFactory ;
19
19
import org .springframework .context .annotation .Bean ;
20
20
import org .springframework .context .annotation .Configuration ;
21
21
import org .springframework .context .annotation .Primary ;
35
35
class EntityLinksConfiguration {
36
36
37
37
@ Bean
38
- OrderAwarePluginRegistry <EntityLinks , Class <?>> entityLinksPluginRegistry (ApplicationContext context ) {
38
+ OrderAwarePluginRegistry <EntityLinks , Class <?>> entityLinksPluginRegistry (ListableBeanFactory beanFactory ) {
39
39
40
40
PluginRegistryFactoryBean <EntityLinks , Class <?>> registry = new PluginRegistryFactoryBean <>();
41
- registry .setApplicationContext ( context );
41
+ registry .setBeanFactory ( beanFactory );
42
42
registry .setType (EntityLinks .class );
43
43
registry .setExclusions (new Class [] { DelegatingEntityLinks .class });
44
- registry .afterPropertiesSet ();
45
44
46
45
return registry .getObject ();
47
46
}
Original file line number Diff line number Diff line change 24
24
import java .util .Properties ;
25
25
import java .util .stream .Collectors ;
26
26
27
+ import org .springframework .beans .factory .ListableBeanFactory ;
27
28
import org .springframework .beans .factory .ObjectProvider ;
28
29
import org .springframework .beans .factory .annotation .Autowired ;
29
30
import org .springframework .beans .factory .config .PropertiesFactoryBean ;
@@ -107,13 +108,13 @@ DelegatingLinkRelationProvider _relProvider(
107
108
}
108
109
109
110
@ Bean
110
- OrderAwarePluginRegistry <LinkRelationProvider , LookupContext > relProviderPluginRegistry (ApplicationContext context ) {
111
+ OrderAwarePluginRegistry <LinkRelationProvider , LookupContext > relProviderPluginRegistry (
112
+ ListableBeanFactory beanFactory ) {
111
113
112
114
PluginRegistryFactoryBean <LinkRelationProvider , LookupContext > factory = new PluginRegistryFactoryBean <>();
113
- factory .setApplicationContext ( context );
115
+ factory .setBeanFactory ( beanFactory );
114
116
factory .setType (LinkRelationProvider .class );
115
117
factory .setExclusions (new Class [] { DelegatingLinkRelationProvider .class });
116
- factory .afterPropertiesSet ();
117
118
118
119
return factory .getObject ();
119
120
}
Original file line number Diff line number Diff line change 22
22
import org .springframework .hateoas .TestUtils ;
23
23
import org .springframework .hateoas .server .EntityLinks ;
24
24
import org .springframework .hateoas .server .ExposesResourceFor ;
25
- import org .springframework .plugin .core .SimplePluginRegistry ;
25
+ import org .springframework .plugin .core .OrderAwarePluginRegistry ;
26
26
import org .springframework .web .bind .annotation .RequestMapping ;
27
27
28
28
/**
@@ -43,7 +43,7 @@ void rejectsNullPluginRegistry() {
43
43
@ Test
44
44
void throwsExceptionForUnsupportedClass () {
45
45
46
- EntityLinks links = new DelegatingEntityLinks (SimplePluginRegistry .empty ());
46
+ EntityLinks links = new DelegatingEntityLinks (OrderAwarePluginRegistry .empty ());
47
47
48
48
assertThatExceptionOfType (IllegalArgumentException .class ) //
49
49
.isThrownBy (() -> links .linkFor (String .class )) //
@@ -84,7 +84,7 @@ void delegatesCallToLinkForItemResource() {
84
84
}
85
85
86
86
private EntityLinks createDelegatingEntityLinks (EntityLinks target ) {
87
- return new DelegatingEntityLinks (SimplePluginRegistry .of (target ));
87
+ return new DelegatingEntityLinks (OrderAwarePluginRegistry .of (target ));
88
88
}
89
89
90
90
@ ExposesResourceFor (String .class )
You can’t perform that action at this time.
0 commit comments