-
Notifications
You must be signed in to change notification settings - Fork 10
refactor: replace generated ApiClient with a manual one #76
refactor: replace generated ApiClient with a manual one #76
Conversation
...ation-service-client/src/main/java/org/eclipse/edc/registration/client/ApiClientFactory.java
Fixed
Show fixed
Hide fixed
...ation-service-client/src/main/java/org/eclipse/edc/registration/client/ApiClientFactory.java
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that most new files are missing the legal file headers. Could you please add them?
implementation(libs.jackson.core) | ||
implementation(libs.bundles.jackson) | ||
implementation(libs.openapi.jackson.databind.nullable) | ||
|
||
testImplementation("com.squareup.okhttp3:mockwebserver:4.10.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - i'm testing the client against the MockServer. An alternative would be to test directly against the RegistrationServiceApiController
, but that would mean spinning up a complete connector runtime.
...ation-service-client/src/main/java/org/eclipse/edc/registration/client/ApiClientFactory.java
Outdated
Show resolved
Hide resolved
...tion-service-client/src/main/java/org/eclipse/edc/registration/client/RegistryApiClient.java
Show resolved
Hide resolved
Will do, thx for noticing |
a593aa6
to
25d4f07
Compare
0f6ebdb
to
00e0adc
Compare
var connectTimeout = Integer.parseInt(propOrEnv(API_CLIENT_CONNECT_TIMEOUT, "30")); | ||
var readTimeout = Integer.parseInt(propOrEnv(API_CLIENT_READ_TIMEOUT, "60")); | ||
public static RegistryApiClient createApiClient(String baseUri, Function<TokenParameters, Result<TokenRepresentation>> credentialsProvider, Monitor monitor, ObjectMapper objectMapper) { | ||
var connectTimeout = Duration.ofSeconds(Integer.parseInt(propOrEnv(API_CLIENT_CONNECT_TIMEOUT, "30"))); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
var readTimeout = Integer.parseInt(propOrEnv(API_CLIENT_READ_TIMEOUT, "60")); | ||
public static RegistryApiClient createApiClient(String baseUri, Function<TokenParameters, Result<TokenRepresentation>> credentialsProvider, Monitor monitor, ObjectMapper objectMapper) { | ||
var connectTimeout = Duration.ofSeconds(Integer.parseInt(propOrEnv(API_CLIENT_CONNECT_TIMEOUT, "30"))); | ||
var readTimeout = Duration.ofSeconds(Integer.parseInt(propOrEnv(API_CLIENT_READ_TIMEOUT, "60"))); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
What this PR changes/adds
Replaces the auto-generated API client with an "explicitly" implemented one.
Why it does that
both the API controller and the client are in this repository, so it does not make much sense to generate the client.
Further, the generated one used the Java Http client, whereas now we can use the
EdcHttpClient
.Further notes
MockWebServer
to verify that the client sends the correct requests.Linked Issue(s)
Closes #75
Checklist
no-changelog
)