@Test
  public void testGetKBFoldersAndKBArticlesCountInRootKBFolderByDraftStatus() throws Exception {

    addKBArticle(KBFolderConstants.DEFAULT_PARENT_FOLDER_ID, RandomTestUtil.randomString());

    Assert.assertEquals(
        1,
        KBFolderLocalServiceUtil.getKBFoldersAndKBArticlesCount(
            _group.getGroupId(),
            KBFolderConstants.DEFAULT_PARENT_FOLDER_ID,
            WorkflowConstants.STATUS_DRAFT));
  }
  @Test
  public void testGetKBFoldersAndKBArticlesCountInKBFolder() throws Exception {

    addKBArticle(_kbFolder.getKbFolderId(), RandomTestUtil.randomString());
    addKBArticle(_kbFolder.getKbFolderId(), RandomTestUtil.randomString());

    addKBFolder(_kbFolder.getKbFolderId());

    Assert.assertEquals(
        3,
        KBFolderLocalServiceUtil.getKBFoldersAndKBArticlesCount(
            _group.getGroupId(), _kbFolder.getKbFolderId(), WorkflowConstants.STATUS_ANY));
  }
  @Test
  public void testGetKBFoldersAndKBArticlesCountWithMultipleKBArticleVersions() throws Exception {

    KBArticle kbArticle =
        addKBArticle(KBFolderConstants.DEFAULT_PARENT_FOLDER_ID, RandomTestUtil.randomString());

    updateKBArticle(kbArticle, RandomTestUtil.randomString());

    Assert.assertEquals(
        2,
        KBFolderLocalServiceUtil.getKBFoldersAndKBArticlesCount(
            _group.getGroupId(),
            KBFolderConstants.DEFAULT_PARENT_FOLDER_ID,
            WorkflowConstants.STATUS_ANY));
  }
  @Test
  public void testGetKBFoldersAndKBArticlesCountKBFolderImmediateChildren() throws Exception {

    KBArticle parentKBArticle =
        addKBArticle(_kbFolder.getKbFolderId(), RandomTestUtil.randomString());

    addChildKBArticle(parentKBArticle, RandomTestUtil.randomString());

    addKBFolder(_kbFolder.getKbFolderId());

    Assert.assertEquals(
        2,
        KBFolderLocalServiceUtil.getKBFoldersAndKBArticlesCount(
            _group.getGroupId(), _kbFolder.getKbFolderId(), WorkflowConstants.STATUS_ANY));
  }