You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(spring): Add unit tests for clientRegistrationId option
Add tests to verify:
- @ClientRegistrationId annotation is generated when option is set
- Annotation is not present when option is not configured
Also regenerate complete samples for spring-http-interface-oauth config.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: samples/client/petstore/spring-http-interface-oauth/README.md
+14-25Lines changed: 14 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
3
3
This sample demonstrates the use of the `@ClientRegistrationId` annotation with Spring HTTP Interface clients.
4
4
5
-
## Feature
5
+
## Overview
6
6
7
-
When generating Spring HTTP Interface clients, you can now specify a `clientRegistrationId` parameter to automatically add the `@ClientRegistrationId` annotation to all generated interface methods.
7
+
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
8
+
When generating Spring HTTP Interface clients, you can specify a `clientRegistrationId` parameter to automatically add the `@ClientRegistrationId` annotation to all generated API interfaces.
8
9
9
10
## Configuration
10
11
@@ -45,18 +46,16 @@ public interface PetApi {
45
46
}
46
47
```
47
48
48
-
This follows the Spring Security recommendation to add `@ClientRegistrationId` at the type level to avoid repeating the declaration on every method.
49
-
50
49
## Spring Security Integration
51
50
52
51
This annotation is part of Spring Security's OAuth2 integration for HTTP Service Clients. It automatically associates OAuth2 tokens with HTTP requests.
53
52
54
53
### Requirements
55
54
56
-
- Spring Security 7.0+
57
-
- Spring Boot 3.x
55
+
- Spring Boot 3.5+
56
+
- Spring Security 6.5+
58
57
59
-
### Configuration
58
+
### Application Properties
60
59
61
60
Configure your Spring application with the OAuth2 client registration:
62
61
@@ -78,31 +77,21 @@ spring:
78
77
79
78
### Bean Configuration
80
79
81
-
Use `OAuth2RestClientHttpServiceGroupConfigurer` to configure the HTTP Service Proxy Factory:
80
+
Use `RestClientHttpServiceGroupConfigurer` to configure the HTTP Service Proxy Factory:
82
81
83
82
```java
84
83
@Configuration
85
-
public class HttpInterfaceConfig {
86
-
87
-
@Bean
88
-
public PetApi petApi(OAuth2RestClientHttpServiceGroupConfigurer configurer) {
0 commit comments