Skip to content

Commit

Permalink
#20840 adding unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jdotcms committed Jun 15, 2022
1 parent 0f0e264 commit 8531763
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ public void findTaskByContentlet() throws DotDataException, DotSecurityException
* Test the find findAvailableActions methods
*/
@Test
public void findAvailableActions() throws DotDataException, DotSecurityException {
public void findAvailableActions() throws Exception {

/*
Need to do the test checking with different user the actions displayed. We need to specify
Expand Down Expand Up @@ -1456,6 +1456,17 @@ public void findAvailableActions() throws DotDataException, DotSecurityException
assertFalse(foundActions.isEmpty());
assertEquals(foundActions.size(), 5);

////
final Contentlet testContentleti = testContentlet;
runNoLicense(()-> {

CacheLocator.getWorkFlowCache().clearCache();
List<WorkflowAction> foundActions_ = APILocator.getWorkflowAPI()
.findAvailableActions(testContentleti, joeContributor);
Assert.assertFalse(foundActions_.isEmpty());
Assert.assertEquals(WorkflowAPI.SYSTEM_WORKFLOW_ID, foundActions_.get(0).getSchemeId());
});

} finally {
contentletAPI.destroy(testContentlet, user, false);
}
Expand Down

0 comments on commit 8531763

Please sign in to comment.