Merge pull request #3685 from mposolda/master

KEYCLOAK-4128 ResourcePermissionManagementTest fails on Oracle DB
This commit is contained in:
Marek Posolda 2016-12-21 13:44:15 +01:00 committed by GitHub
commit 2ba21485f9
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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) {