test_class.declarator: initializer
test_class.modifier: private
test_class.original_string: private AuthorizationInitializer initializer;
test_class.type: AuthorizationInitializer
test_class.var_name: initializer
test_class.declarator: builder
test_class.modifier: private
test_class.original_string: private NodeBuilder builder;
test_class.type: NodeBuilder
test_class.var_name: builder
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationInitializerTest.java
test_class.identifier: AuthorizationInitializerTest
test_case.body: @Test
      public void testSecondInit() {
          when(builder.hasChildNode(anyString())).thenReturn(true);
          when(builder.hasProperty(anyString())).thenReturn(true);
  
          initializer.initialize(builder, "wspName");
  
          verify(builder, times(4)).hasChildNode(anyString());
          verify(builder, times(3)).child(anyString());
          verify(builder, times(1)).hasProperty(anyString());
          verify(builder, never()).setProperty(any(PropertyState.class));
          verify(builder, never()).setProperty(anyString(), any(Object.class));
          verify(builder, never()).setProperty(anyString(), any(Object.class), any(Type.class));
      }
test_case.class_method_signature: AuthorizationInitializerTest.testSecondInit()
test_case.full_signature: @Test public void testSecondInit()
test_case.identifier: testSecondInit
test_case.invocations: thenReturn when hasChildNode anyString thenReturn when hasProperty anyString initialize hasChildNode verify times anyString child verify times anyString hasProperty verify times anyString setProperty verify never any setProperty verify never anyString any setProperty verify never anyString any any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSecondInit()
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.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AuthorizationInitializer.java
focal_class.identifier: AuthorizationInitializer
focal_class.interfaces: implements WorkspaceInitializer, AccessControlConstants, PermissionConstants
focal_class.class_method_signature: AuthorizationInitializer.AuthorizationInitializer(@NotNull MountInfoProvider mountInfoProvider)
focal_class.full_signature:   AuthorizationInitializer(@NotNull MountInfoProvider mountInfoProvider)
focal_class.identifier: AuthorizationInitializer
focal_class.parameters: (@NotNull MountInfoProvider mountInfoProvider)
focal_class.signature:  AuthorizationInitializer(@NotNull MountInfoProvider mountInfoProvider)
focal_class.class_method_signature: AuthorizationInitializer.initialize(NodeBuilder builder, String workspaceName)
focal_class.full_signature: @Override public void initialize(NodeBuilder builder, String workspaceName)
focal_class.identifier: initialize
focal_class.modifiers: @Override public
focal_class.parameters: (NodeBuilder builder, String workspaceName)
focal_class.return: void
focal_class.signature: void initialize(NodeBuilder builder, String workspaceName)
focal_method.body: @Override
      public void initialize(NodeBuilder builder, String workspaceName) {
          // property index for rep:principalName stored in ACEs
          NodeBuilder index = IndexUtils.getOrCreateOakIndex(builder);
          if (!index.hasChildNode("acPrincipalName")) {
              NodeBuilder acPrincipalName = IndexUtils.createIndexDefinition(index, "acPrincipalName", true, false,
                      ImmutableList.<String>of(REP_PRINCIPAL_NAME),
                      ImmutableList.<String>of(NT_REP_DENY_ACE, NT_REP_GRANT_ACE, NT_REP_ACE));
              acPrincipalName.setProperty("info", "Oak index used by authorization to quickly search a principal by name.");
          }
  
          // create the permission store and the root for this workspace.
          NodeBuilder permissionStore =
                  builder.child(JCR_SYSTEM).child(REP_PERMISSION_STORE);
          if (!permissionStore.hasProperty(JCR_PRIMARYTYPE)) {
              permissionStore.setProperty(JCR_PRIMARYTYPE, NT_REP_PERMISSION_STORE, Type.NAME);
          }
          if (!permissionStore.hasChildNode(workspaceName)) {
              permissionStore.child(workspaceName).setProperty(JcrConstants.JCR_PRIMARYTYPE, NT_REP_PERMISSION_STORE, Type.NAME);
          }
          for (Mount m : mountInfoProvider.getNonDefaultMounts()) {
              String permissionRootName =  MountPermissionProvider.getPermissionRootName(m, workspaceName);
              if (!permissionStore.hasChildNode(permissionRootName)) {
                  permissionStore.child(permissionRootName).setProperty(JcrConstants.JCR_PRIMARYTYPE, NT_REP_PERMISSION_STORE, Type.NAME);
              }
          }
      }
focal_method.class_method_signature: AuthorizationInitializer.initialize(NodeBuilder builder, String workspaceName)
focal_method.full_signature: @Override public void initialize(NodeBuilder builder, String workspaceName)
focal_method.identifier: initialize
focal_method.invocations: getOrCreateOakIndex hasChildNode createIndexDefinition of of setProperty child child hasProperty setProperty hasChildNode setProperty child getNonDefaultMounts getPermissionRootName hasChildNode setProperty child
focal_method.modifiers: @Override public
focal_method.parameters: (NodeBuilder builder, String workspaceName)
focal_method.return: void
focal_method.signature: void initialize(NodeBuilder builder, String workspaceName)