Merge pull request #2164 from mposolda/master

Fix failing test with DB2
This commit is contained in:
Stian Thorgersen 2016-02-03 13:04:57 +01:00
commit adfc93cfc9
3 changed files with 8 additions and 3 deletions

View file

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

View file

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

View file

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