Repository navigation
[OID4VCI] Migrate OID4VCJWTIssuerEndpointTest - #46945
Conversation
|
@mposolda thanks! I rebased the PR and updated the "common parts". |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabledKeycloak CI - Java Distribution IT (windows-latest - temurin - 21) |
|
@graziang It should be OK to restore the work on this PR when you have a chance. The related refactoring was already done. |
83c94cb to
5c42cb9
Compare
|
@mposolda Thanks, rebased and integrated the changes. |
|
@graziang Thank you very much for the PR! Could you please add the "[OID4VCI]" prefix to the PR title? Including it will help ensure the PR is properly captured in our tracking search. |
There was a problem hiding this comment.
Hello @graziang !
Thanks for this PR, i have some minor request, could you check them!
Closes keycloak#46925 Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
There was a problem hiding this comment.
@graziang @Ogenbertrand Thanks for the PR and review!
|
|
||
| protected ClientScopeRepresentation sdJwtTypeCredentialClientScope; | ||
| protected ClientScopeRepresentation jwtTypeCredentialClientScope; | ||
| protected ClientScopeRepresentation minimalJwtTypeCredentialClientScope; |
There was a problem hiding this comment.
These seem to be duplicates of OID4VCIssuerTestBase
| protected ClientScopeRepresentation jwtTypeCredentialClientScope; | ||
| protected ClientScopeRepresentation minimalJwtTypeCredentialClientScope; | ||
|
|
||
| protected CloseableHttpClient httpClient; |
There was a problem hiding this comment.
Is this low level httpClient really needed? We have a good OAuth2Client.oid4vci() API that should be used for client side requests.
| protected ClientScopeRepresentation minimalJwtTypeCredentialClientScope; | ||
|
|
||
| protected CloseableHttpClient httpClient; | ||
| protected ClientRepresentation client; |
| minimalJwtTypeCredentialClientScope = requireExistingClientScope(minimalJwtTypeCredentialScopeName); | ||
| } | ||
|
|
||
| protected static OAuth2CodeEntry prepareSessionCode( |
There was a problem hiding this comment.
AFAICS, this does need to be static. Generally could you please review all usages of 'static'? Many of those seem to be "bad habits" that were simply carried over from the old test suite.
The most likely reason they were static is because the old tests were serialized by ARQ and ran on the server side. The new tests are client side tests and do not need to be serialized anymore to run "in-container". We can stick to standard junit with injected stuff and managed lifecycle.
| } | ||
|
|
||
| CredentialScopeRepresentation createCredentialScope( | ||
| public static CredentialScopeRepresentation createCredentialScope( |
There was a problem hiding this comment.
Its nice that you moved most of the realm setup to VCTestRealmConfig - this method should move as well.
Again, static usage is like not needed - we don't want calls from VCTestRealmConfig to OID4VCIssuerTestBase (unless there is a good reason that I failed to see)
| } | ||
|
|
||
| CredentialScopeRepresentation requireExistingCredentialScope(String scopeName) { | ||
| return Optional.ofNullable(getExistingCredentialScope(scopeName)) | ||
| .orElseThrow(() -> new IllegalStateException("No such credential scope: " + scopeName)); | ||
| } | ||
|
|
||
| ProtocolMapperRepresentation getIssuedAtTimeMapper(String subjectProperty, String truncateToTimeUnit, String valueSource) { | ||
| public static ProtocolMapperRepresentation getIssuedAtTimeMapper(String subjectProperty, String truncateToTimeUnit, String valueSource) { |
There was a problem hiding this comment.
Stuff that is only used for realm setup should live there (no static call needed)
Generally, please review the call hierarchy from VCTestRealmConfig - its good to have it all were it belongs.
Closes #46925
PR to migrate
OID4VCJWTIssuerEndpointTestandOID4VCIssuerEndpointTestto the new test suite.I tried to convert the configurations inside
OID4VCIssuerTestBaseas much as possible to make them compliant with the new test suite.