Merge pull request #3685 from mposolda/master
KEYCLOAK-4128 ResourcePermissionManagementTest fails on Oracle DB
This commit is contained in:
commit
2ba21485f9
2 changed files with 4 additions and 2 deletions
|
@ -168,7 +168,7 @@ public class JPAPolicyStore implements PolicyStore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Policy> findByResourceType(final String resourceType, String resourceServerId) {
|
public List<Policy> findByResourceType(final String resourceType, String resourceServerId) {
|
||||||
Query query = getEntityManager().createQuery("select p from PolicyEntity p inner join p.config c where p.resourceServer.id = :serverId and KEY(c) = 'defaultResourceType' and c = :type");
|
Query query = getEntityManager().createQuery("select p from PolicyEntity p inner join p.config c where p.resourceServer.id = :serverId and KEY(c) = 'defaultResourceType' and c like :type");
|
||||||
|
|
||||||
query.setParameter("serverId", resourceServerId);
|
query.setParameter("serverId", resourceServerId);
|
||||||
query.setParameter("type", resourceType);
|
query.setParameter("type", resourceType);
|
||||||
|
|
|
@ -99,11 +99,13 @@ public abstract class AbstractAuthorizationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Invocation.Builder newClient(ClientModel client, String authzRelativePath) {
|
protected Invocation.Builder newClient(ClientModel client, String authzRelativePath) {
|
||||||
|
String targetUrl = AUTH_SERVER_ROOT + "/admin/realms/" + TEST_REALM_NAME + "/clients/" + client.getId() + "/authz" + authzRelativePath;
|
||||||
|
|
||||||
return ClientBuilder.newClient()
|
return ClientBuilder.newClient()
|
||||||
.register((ClientRequestFilter) requestContext -> {
|
.register((ClientRequestFilter) requestContext -> {
|
||||||
AccessTokenResponse accessToken = adminClient.tokenManager().getAccessToken();
|
AccessTokenResponse accessToken = adminClient.tokenManager().getAccessToken();
|
||||||
requestContext.getHeaders().add("Authorization", "Bearer " + accessToken.getToken());
|
requestContext.getHeaders().add("Authorization", "Bearer " + accessToken.getToken());
|
||||||
}).target(AUTH_SERVER_ROOT + "/admin/realms/" + TEST_REALM_NAME + "/clients/" + client.getId() + "/authz" + authzRelativePath).request();
|
}).target(targetUrl).request();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ClientModel getClientByClientId(String clientId) {
|
protected ClientModel getClientByClientId(String clientId) {
|
||||||
|
|
Loading…
Reference in a new issue