mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 15:02:05 -03:30
Suppress the step's priority in the returned workflow JSON/YAML
Closes #45075 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
This commit is contained in:
parent
985ec6d306
commit
66f3868ccf
@ -72,6 +72,7 @@ public class WorkflowStepRepresentation extends AbstractWorkflowComponentReprese
|
||||
setConfig(CONFIG_AFTER, after);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getPriority() {
|
||||
return getConfigValue(CONFIG_PRIORITY, String.class);
|
||||
}
|
||||
|
||||
@ -89,6 +89,7 @@ public class DefaultWorkflowProvider implements WorkflowProvider {
|
||||
}
|
||||
// set the id of the step to match the existing one, so we can update the config
|
||||
newStep.setId(currentStep.getId());
|
||||
newStep.setPriority(Long.parseLong(currentStep.getPriority()));
|
||||
}
|
||||
|
||||
// finally, update the workflow's config along with the steps' configs
|
||||
|
||||
@ -90,7 +90,9 @@ public class DisableActiveWorkflowTest extends AbstractWorkflowTest {
|
||||
|
||||
// disable the workflow - scheduled steps should be paused and workflow should not activate for new users
|
||||
workflow.setEnabled(false);
|
||||
managedRealm.admin().workflows().workflow(workflowId).update(workflow).close();
|
||||
try (Response response = managedRealm.admin().workflows().workflow(workflowId).update(workflow)) {
|
||||
assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
|
||||
}
|
||||
|
||||
// create another user - should NOT bind the user to the workflow as it is disabled
|
||||
managedRealm.admin().users().create(UserConfigBuilder.create().username("anotheruser").build()).close();
|
||||
@ -119,8 +121,10 @@ public class DisableActiveWorkflowTest extends AbstractWorkflowTest {
|
||||
});
|
||||
|
||||
// re-enable the workflow - scheduled steps should resume and new users should be bound to the workflow
|
||||
workflow.getConfig().putSingle("enabled", "true");
|
||||
managedRealm.admin().workflows().workflow(workflowId).update(workflow).close();
|
||||
workflow.setEnabled(true);
|
||||
try (Response response = managedRealm.admin().workflows().workflow(workflowId).update(workflow)) {
|
||||
assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus());
|
||||
}
|
||||
|
||||
// create a third user - should bind the user to the workflow as it is enabled again
|
||||
managedRealm.admin().users().create(UserConfigBuilder.create().username("thirduser").email("thirduser@example.com").build()).close();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user