-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Move ConsentsTest.java to the new testsuite #40323
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
Conversation
|
waiting for the UserTest PR being merged, there are Page dependencies: #39805 |
f9c9b5f to
f627489
Compare
| private boolean isRefreshToken(String refreshToken) { | ||
| String[] items = refreshToken.split(":"); | ||
| if (items.length != 2) return false; | ||
| // Grant type shortcut starts at character 4th char and is 2-chars long | ||
| if (!items[0].substring(3, 5).equals(RefreshTokenGrantTypeFactory.GRANT_SHORTCUT)) return false; | ||
|
|
||
| return isRefreshToken(items[1]); | ||
| } |
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.
This method appears to be unused
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.
thanks, removed
| @InjectRealm(ref = "user") | ||
| ManagedRealm managedRealm; | ||
|
|
||
| protected String consumerRealmName() { | ||
| return REALM_CONS_NAME; | ||
| } | ||
| @InjectRealm(ref = "consumer", config = ConsentsRealmCConf.class, lifecycle = LifeCycle.METHOD) | ||
| ManagedRealm consumerRealm; | ||
|
|
||
| protected String getIDPAlias() { | ||
| return IDP_OIDC_ALIAS; | ||
| } | ||
| @InjectRealm(ref = "provider", lifecycle = LifeCycle.METHOD) | ||
| ManagedRealm providerRealm; | ||
|
|
||
| @Rule | ||
| public AssertEvents events = new AssertEvents(this); | ||
| @InjectUser(ref = "user", realmRef = "user", config = ConsentsUserConf.class) | ||
| ManagedUser user; | ||
|
|
||
| @Page | ||
| protected LoginPage accountLoginPage; | ||
| @InjectUser(ref = "provider", realmRef = "provider", config = ConsentsUserPConf.class) | ||
| ManagedUser userP; | ||
|
|
||
| @Page | ||
| protected ConsentPage consentPage; | ||
| @InjectClient(realmRef = "provider", config = ConsentsClientPConf.class) | ||
| ManagedClient client; | ||
|
|
||
| @Page | ||
| protected AppPage appPage; | ||
| @InjectOAuthClient(ref = "user", realmRef = "user") | ||
| OAuthClient oauth; | ||
|
|
||
| @Page | ||
| protected ErrorPage errorPage; | ||
| @InjectOAuthClient(ref = "consumer", realmRef = "consumer") | ||
| OAuthClient oauthC; | ||
|
|
||
| @Override | ||
| public void addTestRealms(List<RealmRepresentation> testRealms) { | ||
| RealmRepresentation providerRealm = createProviderRealm(); | ||
| RealmRepresentation consumerRealm = createConsumerRealm(); | ||
| RealmRepresentation realmRepresentation = loadJson(getClass().getResourceAsStream("/testrealm.json"), RealmRepresentation.class); | ||
| @InjectOAuthClient(ref = "provider", realmRef = "provider") | ||
| OAuthClient oauthP; | ||
|
|
||
| testRealms.add(providerRealm); | ||
| testRealms.add(consumerRealm); | ||
| testRealms.add(realmRepresentation); | ||
| } | ||
| @InjectEvents(realmRef = "user") | ||
| Events events; |
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.
The naming in this area is confusing. There's a managedRealm with a ref="user", in that realm, there's a user. There's also a userP which is in providerRealm.
I would unify the names and be a bit more descriptive than oauthC
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.
thanks, updated
Signed-off-by: Lukas Hanusovsky <[email protected]>
Part of: keycloak#34494 Signed-off-by: Lukas Hanusovsky <[email protected]>
* Moving files to the new test suite Signed-off-by: Lukas Hanusovsky <[email protected]> * Move ConsentsTest.java, UserRoleTest.java to the new testsuite Part of: keycloak#34494 Signed-off-by: Lukas Hanusovsky <[email protected]> --------- Signed-off-by: Lukas Hanusovsky <[email protected]> Signed-off-by: Robin Meese <[email protected]>
Part of: #34494