Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-4121

[Configurable Entities] Refactor `CsvImportIT` Integration Test to use AbstractBuilder model

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Code Review Needed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: 7.0
    • Component/s: REST API v7
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      1
    • Documentation Status:
      Not Required

      Description

      Per comment in this PR: https://github.com/DSpace/DSpace/pull/2269#discussion_r242340147

      All REST API Integration Tests should adopt the AbstractBuilder approach that is used by all other REST API integration testshttps://github.com/DSpace/DSpace/blob/master/dspace-spring-rest/src/test/java/org/dspace/app/rest/builder/AbstractBuilder.java

      In this approach, all DSpace Objects are represented as Builder objects, which can be used in any Integration Tests, and are automatically cleaned up by a call to AbstractBuilder.cleanupObjects(), which is called automatically after each IT by AbstractIntegrationTestWithDatabase here: https://github.com/DSpace/DSpace/blob/master/dspace-spring-rest/src/test/java/org/dspace/app/rest/test/AbstractIntegrationTestWithDatabase.java#L172

      This allows Integration Test cleanup to be automated, instead of having to manually cleanup objects in each IT class.

      This Integration Test should be refactored to follow this same model. Once properly refactored, this entire "destroy()" method should no longer need to exist (as it will be automated via "AbstractBuilder"): https://github.com/DSpace/DSpace/blob/configurable_entities/dspace-spring-rest/src/test/java/org/dspace/app/rest/csv/CsvImportIT.java#L75 

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tdonohue Tim Donohue
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: