test_class.file: core/src/test/java/org/apache/sling/cms/core/internal/CommonUtilsTest.java
test_class.identifier: CommonUtilsTest
test_case.body: @Test
      public void testGetUserManagerNullSession() {
          try {
              CommonUtils.getUserManager(Mockito.mock(ResourceResolver.class));
              fail();
          } catch (RepositoryException re) {
              assertEquals("Failed to get user manager", re.getMessage());
          }
      }
test_case.class_method_signature: CommonUtilsTest.testGetUserManagerNullSession()
test_case.full_signature: @Test public void testGetUserManagerNullSession()
test_case.identifier: testGetUserManagerNullSession
test_case.invocations: getUserManager mock fail assertEquals getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetUserManagerNullSession()
focal_class.declarator: log = LoggerFactory.getLogger(CommonUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(CommonUtils.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: core/src/main/java/org/apache/sling/cms/core/internal/CommonUtils.java
focal_class.identifier: CommonUtils
focal_class.class_method_signature: CommonUtils.CommonUtils()
focal_class.full_signature: private  CommonUtils()
focal_class.identifier: CommonUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  CommonUtils()
focal_class.class_method_signature: CommonUtils.getUserManager(@NotNull ResourceResolver resolver)
focal_class.full_signature: public static final UserManager getUserManager(@NotNull ResourceResolver resolver)
focal_class.identifier: getUserManager
focal_class.modifiers: public static final
focal_class.parameters: (@NotNull ResourceResolver resolver)
focal_class.return: UserManager
focal_class.signature: UserManager getUserManager(@NotNull ResourceResolver resolver)
focal_method.body: public static final UserManager getUserManager(@NotNull ResourceResolver resolver) throws RepositoryException {
          return Optional.ofNullable(resolver.adaptTo(Session.class)).map(session -> {
              UserManager userManager = null;
              if (session instanceof JackrabbitSession) {
                  try {
                      userManager = ((JackrabbitSession) session).getUserManager();
                  } catch (RepositoryException e) {
                      log.error("Failed to get user manager", e);
                  }
  
              }
              return userManager;
          }).orElseThrow(() -> new RepositoryException("Failed to get user manager"));
      }
focal_method.class_method_signature: CommonUtils.getUserManager(@NotNull ResourceResolver resolver)
focal_method.full_signature: public static final UserManager getUserManager(@NotNull ResourceResolver resolver)
focal_method.identifier: getUserManager
focal_method.invocations: orElseThrow map ofNullable adaptTo getUserManager error
focal_method.modifiers: public static final
focal_method.parameters: (@NotNull ResourceResolver resolver)
focal_method.return: UserManager
focal_method.signature: UserManager getUserManager(@NotNull ResourceResolver resolver)