-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add conditional workflow for test-poc #31406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,13 @@ | |
| public class NoAdminUserKeycloakTestServerConfig implements KeycloakTestServerConfig { | ||
|
|
||
| @Override | ||
| public Optional<String> adminUserName() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a fan of my optionals? 😢
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They have their place, but found it easier to not have it in this case, as it's both simpler to just return null, and found the checks when setting the values simpler without optional stuff ;)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it's a matter of personal preference I guess. However using optionals forces you to handle nullability, whereas nulls do not. Also: serverConfig.adminUserName().ifPresentOrElse(
username -> System.setProperty("keycloakAdmin", username),
() -> System.getProperties().remove("keycloakAdmin")
); |
||
| return Optional.empty(); | ||
| public String adminUserName() { | ||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<String> adminUserPassword() { | ||
| return Optional.empty(); | ||
| public String adminUserPassword() { | ||
| return null; | ||
| } | ||
|
|
||
| } | ||
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.
You can omit the
idif you are not referencing it anywhere.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.
Yup, just copy/paste from elsewhere though. Having id/name makes the run a bit more readable though as the output with reusable actions is not very elegant without it.
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.
Yeah, I'd just add a human readable name to it and call it a day