Package org.kuali.rice.kew.routeheader

Examples of org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue


   
    BusinessObjectService boSvc = mock(BusinessObjectService.class);
    annexTypeApprovalSplit.setBusinessObjectService(boSvc);
   
    RouteContext context = mock(RouteContext.class);
    DocumentRouteHeaderValue docHdr = mock(DocumentRouteHeaderValue.class);
    when(context.getDocument()).thenReturn(docHdr);
   
    MatterWork work = mock(MatterWork.class);
    MatterAnnexType annexType = new MatterAnnexType();
    when(work.getAnnexType()).thenReturn(annexType);
   
    final String documentId = "2013";
    when(docHdr.getDocumentId()).thenReturn(documentId);
    when(boSvc.findBySinglePrimaryKey(same(MatterWork.class), same(documentId))).thenReturn(work);
    assertTrue("branch list should be empty since requiresApproval is by default false"
        annexTypeApprovalSplit.process(context, null).getBranchNames().isEmpty());
   
    annexType.setRequiresApproval(true);
    final List<String> branchNames = annexTypeApprovalSplit.process(context, null).getBranchNames();
    assertFalse("branch list should not be empty since requiresApproval is set to true", branchNames.isEmpty());
    assertEquals("branch name differs", MartinlawConstants.RoutingBranches.ANNEX_TYPE_APPROVAL, branchNames.get(0));
   
    when(work.getAnnexType()).thenReturn(null);
    assertTrue("branch list should be empty since annex type is null"
        annexTypeApprovalSplit.process(context, null).getBranchNames().isEmpty());
   
    when(docHdr.getDocumentId()).thenReturn("none existent doc id");
    assertFalse("branch list should not be empty if document does not exist, workflow testing mode is assumed"
        annexTypeApprovalSplit.process(context, null).getBranchNames().isEmpty());
   
    when(boSvc.findBySinglePrimaryKey(same(MatterWork.class), same(documentId))).thenReturn(null);
    assertFalse("branch list should not be empty since when work is null, workflow testing mode is assumed"
View Full Code Here

TOP

Related Classes of org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.