Search in sources :

Example 1 with TreeStorageNodePrescription

use of org.keycloak.models.map.storage.tree.TreeStorageNodePrescription in project keycloak by keycloak.

the class PerFieldDelegateProviderCacheTest method prepareEntityAndTreeNodeInstances.

private MapClientEntity prepareEntityAndTreeNodeInstances() {
    TreeStorageNodePrescription upperTsnp = new TreeStorageNodePrescription(upperNodeProperties, null, null);
    TreeStorageNodePrescription lowerTsnp = new TreeStorageNodePrescription(lowerNodeProperties, null, null);
    upperTsni = new TreeStorageNodeInstance<>(null, upperTsnp);
    lowerTsni = new TreeStorageNodeInstance<>(null, lowerTsnp);
    PerFieldDelegateProvider<MapClientEntity> fieldProvider = new PerFieldDelegateProvider<>(upperTsni.new WithEntity(upperEnt), () -> {
        lowerEntSupplierCallCount.incrementAndGet();
        return lowerEnt;
    });
    return DeepCloner.DUMB_CLONER.entityFieldDelegate(MapClientEntity.class, fieldProvider);
}
Also used : MapClientEntity(org.keycloak.models.map.client.MapClientEntity) TreeStorageNodePrescription(org.keycloak.models.map.storage.tree.TreeStorageNodePrescription)

Example 2 with TreeStorageNodePrescription

use of org.keycloak.models.map.storage.tree.TreeStorageNodePrescription in project keycloak by keycloak.

the class PerFieldDelegateProviderPrimarySourceTest method prepareEntityAndTreeNodeInstances.

private MapClientEntity prepareEntityAndTreeNodeInstances() {
    TreeStorageNodePrescription upperTsnp = new TreeStorageNodePrescription(upperNodeProperties, null, null);
    TreeStorageNodePrescription lowerTsnp = new TreeStorageNodePrescription(lowerNodeProperties, null, null);
    upperTsni = new TreeStorageNodeInstance<>(null, upperTsnp);
    lowerTsni = new TreeStorageNodeInstance<>(null, lowerTsnp);
    PerFieldDelegateProvider<MapClientEntity> fieldProvider = new PerFieldDelegateProvider<>(upperTsni.new WithEntity(upperEnt), () -> {
        lowerEntSupplierCallCount.incrementAndGet();
        return lowerEnt;
    });
    return DeepCloner.DUMB_CLONER.entityFieldDelegate(MapClientEntity.class, fieldProvider);
}
Also used : MapClientEntity(org.keycloak.models.map.client.MapClientEntity) TreeStorageNodePrescription(org.keycloak.models.map.storage.tree.TreeStorageNodePrescription)

Aggregations

MapClientEntity (org.keycloak.models.map.client.MapClientEntity)2 TreeStorageNodePrescription (org.keycloak.models.map.storage.tree.TreeStorageNodePrescription)2