Repository navigation
Refactor builders in testsuite part 2 - #48454
Conversation
1d98d90 to
802958a
Compare
291847d to
8426330
Compare
9ecc43b to
55e4634
Compare
7f23cae to
8c75187
Compare
|
|
||
| import static org.keycloak.models.jpa.entities.RealmAttributes.ACTION_TOKEN_GENERATED_BY_USER_LIFESPAN; | ||
|
|
||
| public class RealmAttributesBuilder { |
There was a problem hiding this comment.
do you plan to have it as an extension to Builder class?
There was a problem hiding this comment.
No, no need for that
| public RealmBuilder client(ClientRepresentation client) { | ||
| rep.setClients(Collections.combine(rep.getClients(), client)); | ||
| @Deprecated | ||
| public RealmBuilder publicKey(String publicKey) { |
There was a problem hiding this comment.
is it for backward compatibility?
| rep.setClients(Collections.combine(rep.getClients(), client)); | ||
| return ClientBuilder.update(client).enabled(true).clientId(clientId); | ||
| @Deprecated | ||
| public RealmBuilder privateKey(String privateKey) { |
There was a problem hiding this comment.
is it for backward compatibility?
| @@ -75,7 +74,7 @@ public void beforeBrokerTest() { | |||
| // refresh flow to find its id | |||
| clientFlow = findFlowByAlias(clientFlow.getAlias(), realmResource.flows().getFlows()); | |||
|
|
|||
| AuthenticationExecutionRepresentation execution = ExecutionBuilder.create() | |||
| AuthenticationExecutionRepresentation execution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |||
There was a problem hiding this comment.
plus add import
| AuthenticationExecutionRepresentation execution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |
| AuthenticationExecutionRepresentation execution = AuthenticationExecutionBuilder.create() |
| @@ -63,7 +62,7 @@ public void beforeBrokerTest() { | |||
| } | |||
|
|
|||
| private void addExecution(AuthenticationManagementResource authMgmtResource, String flowId, String providerId, int priority) { | |||
| AuthenticationExecutionRepresentation exec = ExecutionBuilder.create() | |||
| AuthenticationExecutionRepresentation exec = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |||
There was a problem hiding this comment.
plus add import
| AuthenticationExecutionRepresentation exec = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |
| AuthenticationExecutionRepresentation exec = AuthenticationExecutionBuilder.create() |
| .id("username password form") | ||
| .parentFlow(this.flow.getId()) | ||
| .requirement(AuthenticationExecutionModel.Requirement.REQUIRED.name()) | ||
| .authenticator(UsernamePasswordFormFactory.PROVIDER_ID) | ||
| .build(); | ||
|
|
||
| AuthenticationExecutionRepresentation authScriptExecution = ExecutionBuilder.create() | ||
| AuthenticationExecutionRepresentation authScriptExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() |
There was a problem hiding this comment.
| AuthenticationExecutionRepresentation authScriptExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |
| AuthenticationExecutionRepresentation authScriptExecution = AuthenticationExecutionBuilder.create() |
| @@ -185,7 +184,7 @@ public void loginShouldFailWithScriptAuthenticator() { | |||
| */ | |||
| @Test | |||
| public void scriptWithClientSession() { | |||
| AuthenticationExecutionRepresentation authScriptExecution = ExecutionBuilder.create() | |||
| AuthenticationExecutionRepresentation authScriptExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |||
There was a problem hiding this comment.
| AuthenticationExecutionRepresentation authScriptExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |
| AuthenticationExecutionRepresentation authScriptExecution = AuthenticationExecutionBuilder.create() |
| @@ -152,14 +151,14 @@ public void configureFlows() throws Exception { | |||
|
|
|||
| this.flow = findFlowByAlias(scriptFlow); | |||
|
|
|||
| AuthenticationExecutionRepresentation usernamePasswordFormExecution = ExecutionBuilder.create() | |||
| AuthenticationExecutionRepresentation usernamePasswordFormExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |||
There was a problem hiding this comment.
plus add import
| AuthenticationExecutionRepresentation usernamePasswordFormExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |
| AuthenticationExecutionRepresentation usernamePasswordFormExecution = AuthenticationExecutionBuilder.create() |
| .id("username password form") | ||
| .parentFlow(this.flow.getId()) | ||
| .requirement(AuthenticationExecutionModel.Requirement.REQUIRED.name()) | ||
| .authenticator(UsernamePasswordFormFactory.PROVIDER_ID) | ||
| .build(); | ||
|
|
||
| AuthenticationExecutionRepresentation authScriptExecution = ExecutionBuilder.create() | ||
| AuthenticationExecutionRepresentation authScriptExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() |
There was a problem hiding this comment.
| AuthenticationExecutionRepresentation authScriptExecution = org.keycloak.testframework.realm.AuthenticationExecutionBuilder.create() | |
| AuthenticationExecutionRepresentation authScriptExecution = AuthenticationExecutionBuilder.create() |
There was a problem hiding this comment.
Updating
| @@ -35,38 +35,25 @@ | |||
| <dependency> | |||
| <groupId>org.keycloak</groupId> | |||
| <artifactId>keycloak-core</artifactId> | |||
| <exclusions> | |||
There was a problem hiding this comment.
removing this exclusion -> wouldn't it bring multiple unused dependencies inside the test framework?
There was a problem hiding this comment.
Doesn't matter as the framework as a dep on this regardless due to the embedded server
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.model.user.UserModelTest#testAddDirtyRemoveFederationUsersInTheSameGroupConcurrentKeycloak CI - Store Model Tests |
Closes keycloak#48452 Signed-off-by: stianst <stianst@gmail.com>
8c75187 to
a140e2b
Compare
Closes keycloak#48452 Signed-off-by: stianst <stianst@gmail.com>
Closes #48452
Signed-off-by: stianst stianst@gmail.com