Merge pull request #2164 from mposolda/master
Fix failing test with DB2
This commit is contained in:
commit
adfc93cfc9
3 changed files with 8 additions and 3 deletions
|
@ -744,6 +744,9 @@ public class RealmAdapter implements RealmModel {
|
|||
|
||||
@Override
|
||||
public ClientModel addClient(String id, String clientId) {
|
||||
if (clientId == null) {
|
||||
clientId = id;
|
||||
}
|
||||
ClientEntity entity = new ClientEntity();
|
||||
entity.setId(id);
|
||||
entity.setClientId(clientId);
|
||||
|
|
|
@ -853,6 +853,11 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
|
|||
clientEntity.setStandardFlowEnabled(true);
|
||||
getMongoStore().insertEntity(clientEntity, invocationContext);
|
||||
|
||||
if (clientId == null) {
|
||||
clientEntity.setClientId(clientEntity.getId());
|
||||
getMongoStore().updateEntity(clientEntity, invocationContext);
|
||||
}
|
||||
|
||||
final ClientModel model = new ClientAdapter(session, this, clientEntity, invocationContext);
|
||||
session.getKeycloakSessionFactory().publish(new ClientCreationEvent() {
|
||||
@Override
|
||||
|
|
|
@ -51,9 +51,6 @@ public abstract class AbstractClientRegistrationProvider implements ClientRegist
|
|||
|
||||
try {
|
||||
ClientModel clientModel = RepresentationToModel.createClient(session, session.getContext().getRealm(), client, true);
|
||||
if (client.getClientId() == null) {
|
||||
clientModel.setClientId(clientModel.getId());
|
||||
}
|
||||
|
||||
client = ModelToRepresentation.toRepresentation(clientModel);
|
||||
|
||||
|
|
Loading…
Reference in a new issue