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