@Override public PrismObject<ShadowType> createBlankShadow(RefinedObjectClassDefinition definition) { return structuralObjectClassDefinition.createBlankShadow(definition); }
@Override public PrismObject<ShadowType> createBlankShadow(RefinedObjectClassDefinition definition) { return refinedObjectClassDefinition.createBlankShadow(definition); }
PrismObject<ShadowType> createBlankShadow(RefinedObjectClassDefinition definition);
+ " not found in the context, but it should be there"); PrismObject<ShadowType> newAccount = rObjectClassDef.createBlankShadow(); addDelta.setObjectToAdd(newAccount);
@Test public void test120CreateShadow() throws Exception { final String TEST_NAME = "test120CreateShadow"; TestUtil.displayTestTitle(TEST_NAME); // GIVEN PrismContext prismContext = createInitializedPrismContext(); PrismObject<ResourceType> resource = prismContext.parseObject(RESOURCE_COMPLEX_FILE); ResourceType resourceType = resource.asObjectable(); RefinedResourceSchema rSchema = RefinedResourceSchemaImpl.parse(resourceType, prismContext); assertNotNull("Refined schema is null", rSchema); assertFalse("No account definitions", rSchema.getRefinedDefinitions(ShadowKindType.ACCOUNT).isEmpty()); RefinedObjectClassDefinition rAccount = rSchema.getRefinedDefinition(ShadowKindType.ACCOUNT, (String)null); // WHEN PrismObject<ShadowType> blankShadow = rAccount.createBlankShadow(); // THEN assertNotNull("No blank shadow", blankShadow); assertNotNull("No prism context in blank shadow", blankShadow.getPrismContext()); PrismObjectDefinition<ShadowType> objectDef = blankShadow.getDefinition(); assertNotNull("Blank shadow has no definition", objectDef); PrismContainerDefinition<?> attrDef = objectDef.findContainerDefinition(ShadowType.F_ATTRIBUTES); assertNotNull("Blank shadow has no definition for attributes", attrDef); assertTrue("Wrong class for attributes definition: "+attrDef.getClass(), attrDef instanceof ResourceAttributeContainerDefinition); }
RefinedObjectClassDefinition rOCD = getCompositeObjectClassDefinition(); if (rOCD != null) { base = rOCD.createBlankShadow();