Skip to content

Commit

Permalink
fixed junit tests
Browse files Browse the repository at this point in the history
Issue #10
  • Loading branch information
rsoika committed Jul 30, 2019
1 parent 7686a47 commit db0b3b3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/org/imixs/example/TestBPMN.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import static org.mockito.Mockito.when;

import java.security.Principal;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.engine.ModelPluginMock;
import org.imixs.workflow.engine.WorkflowMockEnvironment;
import org.imixs.workflow.engine.WorkflowService;
import org.imixs.workflow.engine.plugins.OwnerPlugin;
import org.imixs.workflow.exceptions.AdapterException;
import org.imixs.workflow.exceptions.ModelException;
Expand Down Expand Up @@ -55,6 +57,7 @@ public void setup() throws PluginException, ModelException, AdapterException {
workflowMockEnvironment.getModelService().addModel(new ModelPluginMock(workflowMockEnvironment.getModel(),
"org.imixs.workflow.engine.plugins.HistoryPlugin",
"org.imixs.workflow.engine.plugins.ApplicationPlugin",
"org.imixs.workflow.engine.plugins.OwnerPlugin",
"org.imixs.workflow.engine.plugins.RulePlugin"));
} catch (ModelException e) {
e.printStackTrace();
Expand All @@ -65,6 +68,7 @@ public void setup() throws PluginException, ModelException, AdapterException {
/**
* Simple Test
*/
@SuppressWarnings("unchecked")
@Test
public void testSimple() {

Expand All @@ -79,6 +83,16 @@ public void testSimple() {
Assert.assertEquals(1100, workitem.getTaskID());
Assert.assertEquals("manfred", workitem.getItemValue(OwnerPlugin.OWNER, String.class));


// test $writeaccess
List<String> writeAccess = workitem.getItemValue(WorkflowService.WRITEACCESS);
Assert.assertTrue(writeAccess.contains("{process:Finance:assist}"));
Assert.assertTrue(writeAccess.contains("manfred"));

// test $readaccess
Assert.assertTrue(workitem.getItemValueString(WorkflowService.READACCESS).isEmpty());


} catch (Exception e) {
e.printStackTrace();
Assert.fail();
Expand Down

0 comments on commit db0b3b3

Please sign in to comment.