test_class.declarator: importer
test_class.modifier: private
test_class.original_string: private CugImporter importer;
test_class.type: CugImporter
test_class.var_name: importer
test_class.file: oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugImporterTest.java
test_class.identifier: CugImporterTest
test_class.superclass: extends AbstractCugTest
test_case.body: @Test
      public void testHandlePropertyPropDefWithWrongDeclaringNt() throws Exception {
          createCug(root, SUPPORTED_PATH, "principalName");
          Tree cugParent = root.getTree(SUPPORTED_PATH).getChild(REP_CUG_POLICY);
  
          PropInfo propInfo = when(mock(PropInfo.class).getName()).thenReturn(REP_PRINCIPAL_NAMES).getMock();
  
          NodeType nt = when(mock(NodeType.class).getName()).thenReturn(NodeTypeConstants.NT_UNSTRUCTURED).getMock();
  
          PropertyDefinition propDef = mock(PropertyDefinition.class);
          when(propDef.isMultiple()).thenReturn(true);
          when(propDef.getDeclaringNodeType()).thenReturn(nt);
  
          assertFalse(importer.handlePropInfo(cugParent, propInfo, propDef));
      }
test_case.class_method_signature: CugImporterTest.testHandlePropertyPropDefWithWrongDeclaringNt()
test_case.full_signature: @Test public void testHandlePropertyPropDefWithWrongDeclaringNt()
test_case.identifier: testHandlePropertyPropDefWithWrongDeclaringNt
test_case.invocations: createCug getChild getTree getMock thenReturn when getName mock getMock thenReturn when getName mock mock thenReturn when isMultiple thenReturn when getDeclaringNodeType assertFalse handlePropInfo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testHandlePropertyPropDefWithWrongDeclaringNt()
focal_class.declarator: log = LoggerFactory.getLogger(CugImporter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(CugImporter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: mountInfoProvider
focal_class.modifier: private final
focal_class.original_string: private final MountInfoProvider mountInfoProvider;
focal_class.type: MountInfoProvider
focal_class.var_name: mountInfoProvider
focal_class.declarator: initialized
focal_class.modifier: private
focal_class.original_string: private boolean initialized;
focal_class.type: boolean
focal_class.var_name: initialized
focal_class.declarator: supportedPaths
focal_class.modifier: private
focal_class.original_string: private Set<String> supportedPaths;
focal_class.type: Set<String>
focal_class.var_name: supportedPaths
focal_class.declarator: importBehavior
focal_class.modifier: private
focal_class.original_string: private int importBehavior;
focal_class.type: int
focal_class.var_name: importBehavior
focal_class.declarator: principalManager
focal_class.modifier: private
focal_class.original_string: private PrincipalManager principalManager;
focal_class.type: PrincipalManager
focal_class.var_name: principalManager
focal_class.file: oak-authorization-cug/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugImporter.java
focal_class.identifier: CugImporter
focal_class.interfaces: implements ProtectedPropertyImporter, CugConstants
focal_class.class_method_signature: CugImporter.CugImporter(@NotNull MountInfoProvider mountInfoProvider)
focal_class.full_signature:   CugImporter(@NotNull MountInfoProvider mountInfoProvider)
focal_class.identifier: CugImporter
focal_class.parameters: (@NotNull MountInfoProvider mountInfoProvider)
focal_class.signature:  CugImporter(@NotNull MountInfoProvider mountInfoProvider)
focal_class.class_method_signature: CugImporter.init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider)
focal_class.full_signature: @Override public boolean init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider)
focal_class.return: boolean
focal_class.signature: boolean init(@NotNull Session session, @NotNull Root root, @NotNull NamePathMapper namePathMapper, boolean isWorkspaceImport, int uuidBehavior, @NotNull ReferenceChangeTracker referenceTracker, @NotNull SecurityProvider securityProvider)
focal_class.class_method_signature: CugImporter.processReferences()
focal_class.full_signature: @Override public void processReferences()
focal_class.identifier: processReferences
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void processReferences()
focal_class.class_method_signature: CugImporter.handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_class.full_signature: @Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_class.identifier: handlePropInfo
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_class.return: boolean
focal_class.signature: boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_class.class_method_signature: CugImporter.propertiesCompleted(@NotNull Tree protectedParent)
focal_class.full_signature: @Override public void propertiesCompleted(@NotNull Tree protectedParent)
focal_class.identifier: propertiesCompleted
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Tree protectedParent)
focal_class.return: void
focal_class.signature: void propertiesCompleted(@NotNull Tree protectedParent)
focal_class.class_method_signature: CugImporter.isValid(@NotNull PropInfo propInfo, @NotNull PropertyDefinition def)
focal_class.full_signature: private boolean isValid(@NotNull PropInfo propInfo, @NotNull PropertyDefinition def)
focal_class.identifier: isValid
focal_class.modifiers: private
focal_class.parameters: (@NotNull PropInfo propInfo, @NotNull PropertyDefinition def)
focal_class.return: boolean
focal_class.signature: boolean isValid(@NotNull PropInfo propInfo, @NotNull PropertyDefinition def)
focal_method.body: @Override
      public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def) {
          if (CugUtil.definesCug(parent) && isValid(protectedPropInfo, def) && CugUtil.isSupportedPath(parent.getPath(), supportedPaths)) {
              Set<String> principalNames = new HashSet<>();
              for (TextValue txtValue : protectedPropInfo.getTextValues()) {
                  String principalName = txtValue.getString();
                  Principal principal = principalManager.getPrincipal(principalName);
                  if (principal == null) {
                      switch (importBehavior) {
                          case ImportBehavior.IGNORE:
                              log.debug("Ignoring unknown principal with name '{}'.", principalName);
                              break;
                          case ImportBehavior.BESTEFFORT:
                              log.debug("Importing unknown principal '{}'", principalName);
                              principalNames.add(principalName);
                              break;
                          default: // ImportBehavior.ABORT
                              throw new AccessControlException("Unknown principal '" + principalName + "'.");
                      }
                  } else {
                      principalNames.add(principalName);
                  }
              }
              parent.setProperty(REP_PRINCIPAL_NAMES, principalNames, Type.STRINGS);
              return true;
          } else {
              return false;
          }
      }
focal_method.class_method_signature: CugImporter.handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_method.full_signature: @Override public boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_method.identifier: handlePropInfo
focal_method.invocations: definesCug isValid isSupportedPath getPath getTextValues getString getPrincipal debug debug add add setProperty
focal_method.modifiers: @Override public
focal_method.parameters: (@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)
focal_method.return: boolean
focal_method.signature: boolean handlePropInfo(@NotNull Tree parent, @NotNull PropInfo protectedPropInfo, @NotNull PropertyDefinition def)