Uploaded image for project: 'Radiology Module'
  1. Radiology Module
  2. RAD-382

Create RadiologyReportServiceTest

    XMLWordPrintable

Details

    • High

    Description

      Extract tests that do not need an ApplicationContext and DB into a unit test class RadiologyReportServiceTest (which extends BaseContextMockTest). This will speed up our builds and make it easy to separate unit from integration tests later.

      You can see an example of how the service dependencies are mocked and injected at

      https://github.com/openmrs/openmrs-module-radiology/blob/master/omod/src/test/java/org/openmrs/module/radiology/order/web/RadiologyOrderFormControllerTest.java#L62-L84

      • createRadiologyReport
        • throw illegal argument exception if given null
        • throw api exception if given radiology order is not completed
        • throw api exception if given order has a claimed radiology report
        • throw api exception if given order has a completed radiology report
      • saveRadiologyReportDraft
        • throw illegal argument exception if given null
        • throw illegal argument exception if given radiology report with reportId null
        • throw api exception if radiology report is completed
        • throw api exception if radiology report is voided
        • throw api exception if given radiology reports order has a completed radiology report
      • voidRadiologyReport
        • throw illegal argument exception if given radiology report is null
        • throw illegal argument exception if given radiology report with reportId null
        • throw illegal argument exception if given void reason is null or contains only whitespaces
        • throw api exception if radiology report is completed
      • saveRadiologyReport
        • throw illegal argument exception if given radiology report is null
        • throw illegal argument exception if given radiology report with reportId null
        • throw illegal argument exception if given radiology report with status null
        • throw api exception if radiology report is completed
        • throw api exception if radiology report is voided
        • throw api exception if radiology report is not valid
      • getRadiologyReport
        • throw illegal argument exception if given null
      • getRadiologyReportByUuid
        • throw illegal argument exception if given null
      • hasRadiologyOrderClaimedRadiologyReport
        • throw illegal argument exception if given null
      • hasRadiologyOrderCompletedRadiologyReport
        • throw illegal argument exception if given null
      • getActiveRadiologyReportByRadiologyOrder
        • throw illegal argument exception if given null
      • getRadiologyReports
        • throw illegal argument exception if given null

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                teleivo Ivo Ulrich
                teleivo Ivo Ulrich
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: