Uploaded image for project: 'mod-data-import'
  1. mod-data-import
  2. MODDATAIMP-93

Change validation order for file extension

    XMLWordPrintable

Details

    • EPAM BatchLoader Sprint 11
    • 1
    • Folijet

    Description

      Currently, there are two validations on the backend exist for creating file extensions:
      1. Duplicate file extensions
      2. Invalid file extension

      Now they are executed in the order specified above which may lead to the wrong results.

      Steps to reproduce:
      1. .csv file extension already exists on the server. Make POST request to data-import/fileExtensions endpoint with the following body

      {
        "dataTypes": [],
        "description": "",
        "extension": "  .csv  ",
        "importBlocked": true
      }
      

      The problem is the extension field which has surrounding spaces.

      Expected result:
      The invalid file extension error returns from the server.

      {
          "errors": [
              {
                  "message": "fileExtension.extension.invalid",
                  "parameters": []
              }
          ],
          "total_records": 1
      }
      

      Actual result:
      The duplication error returns from the server.

      {
          "errors": [
              {
                  "message": "fileExtension.duplication.invalid",
                  "parameters": []
              }
          ],
          "total_records": 1
      }
      

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                OleksiiKuzminov Oleksii Kuzminov
                Viktor Soroka Viktor Soroka
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases