Ejemplo n.º 1
0
 public final void testThreshold_InvalidDescription() {
   MaintenanceDocumentBase doc = getMaintenanceDocument(ThresholdFixture.CHARTCODE);
   doc.getDocumentHeader().setDocumentDescription(null);
   assertFalse(thresholdRule.processSaveDocument(doc));
   assertTrue(GlobalVariables.getMessageMap().hasErrors());
   assertTrue(
       GlobalVariables.getMessageMap()
           .getErrorMessages()
           .containsKey("document.documentHeader.documentDescription"));
 }
Ejemplo n.º 2
0
 private MaintenanceDocumentBase getMaintenanceDocument(ThresholdFixture thresholdFixture) {
   MaintenanceDocumentBase doc = null;
   try {
     doc =
         (MaintenanceDocumentBase)
             SpringContext.getBean(DocumentService.class)
                 .getNewDocument(PurapConstants.RECEIVING_THRESHOLD_DOCUMENT_TYPE);
   } catch (WorkflowException e) {
     throw new RuntimeException("Document creation failed.");
   }
   doc.getDocumentHeader().setDocumentDescription("JUnit test document");
   Maintainable maintainableDoc = doc.getNewMaintainableObject();
   maintainableDoc.setBusinessObject(thresholdFixture.getThresholdBO());
   return doc;
 }