Uploaded image for project: 'Document Management System'
  1. Document Management System
  2. DMS-1900

DMS API Testing : Unite test cases changes as per new changes

    Details

    • Type: Maintenance
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Many structural changes are done into DMS like Connection Pooling , Cache , Performance changes.

      We need to go through unit test cases which we written previously , needs to modify unit test cases as per new changes.

        Attachments

          Activity

          Hide
          akash.thakur Akash Thakur (Inactive) added a comment -

          Hi Rohan J Khandave,

          As per our discussions, I have corrected the unit & integration test but was not able to test this test cases due to object disposed error for _context please request you to look into this & let us know to continue the testing.

           

          Thanks,

          Akash Thakur

          Sonali Farakate Ramya Tantry Raj Hawaldar Ganesh Sadawarte Harshveer Singh

          Show
          akash.thakur Akash Thakur (Inactive) added a comment - Hi Rohan J Khandave , As per our discussions, I have corrected the unit & integration test but was not able to test this test cases due to object disposed error for _context please request you to look into this & let us know to continue the testing.   Thanks, Akash Thakur Sonali Farakate Ramya Tantry Raj Hawaldar Ganesh Sadawarte Harshveer Singh
          Show
          harshveer.singh Harshveer Singh (Inactive) added a comment - Akash Thakur , Rohan J Khandave   Sonali Farakate   Ramya Tantry   Raj Hawaldar   Ganesh Sadawarte   Harshveer Singh  refer to this PR for fix for _context disposing issue.  https://github.com/cbdr/DMS/pull/886
          Hide
          harshveer.singh Harshveer Singh (Inactive) added a comment -

          https://github.com/cbdr/DMS/pull/886

          Concern: Dependencies resolved by DependencyResolverHelpercs are disposing as soon as they are created.

          Cause: DependencyResolverHelpercs.GetService method is creating new Scope for each service it needs to resolve, getting dependency from that scope, and immediately disposing newly created scope, because of which all services resolved within that scope are getting disposed.

          Correction: Do not create new scope for each dependency needed, also do not dispose scope immediately.

          Show
          harshveer.singh Harshveer Singh (Inactive) added a comment - https://github.com/cbdr/DMS/pull/886 Concern: Dependencies resolved by DependencyResolverHelpercs are disposing as soon as they are created. Cause: DependencyResolverHelpercs.GetService method is creating new Scope for each service it needs to resolve, getting dependency from that scope, and immediately disposing newly created scope, because of which all services resolved within that scope are getting disposed. Correction: Do not create new scope for each dependency needed, also do not dispose scope immediately.
          Hide
          sonali.farakate Sonali Farakate (Inactive) added a comment - - edited

          Changes done in DMSUserControllerTest.cs

          • public void Post_ShouldLogoutUser() : 
            parameter passed to function LogoutUser() was string, updated this to UserDto object.
            Assert was not working for this hence changed.
          • public void Post_ShouldNotLogoutUser() : 
            parameter passed to function LogoutUser() was string, updated this to UserDto object.
            Assert was not working for this hence changed.
          • Post_ShouldRetrieve_FirstNameForActualUser() : 
            Assert statement was giving warning hence changed.
          • NOTE : Remaining hard coded values(username, password and usertypeID) updated as per pre-prod database.

          CC : Rohan J Khandave

          Show
          sonali.farakate Sonali Farakate (Inactive) added a comment - - edited Changes done in DMSUserControllerTest.cs public void Post_ShouldLogoutUser() :  parameter passed to function LogoutUser() was string, updated this to UserDto object. Assert was not working for this hence changed. public void Post_ShouldNotLogoutUser() :  parameter passed to function LogoutUser() was string, updated this to UserDto object. Assert was not working for this hence changed. Post_ShouldRetrieve_FirstNameForActualUser() :  Assert statement was giving warning hence changed. NOTE : Remaining hard coded values(username, password and usertypeID) updated as per pre-prod database. CC : Rohan J Khandave
          Hide
          akash.thakur Akash Thakur (Inactive) added a comment - - edited

          Changes done in GenerateDocumentControllerTest.cs (all test run successfully)

          • Moved API URL to constants avoided duplicate string everywhere.
          • Resolved correct dependencies for GenerateDocumentController & removed unused services.
          • Removed outdated hardcoded Authorization header values replaced to constants.
          • NOTE: Remaining hardcoded values(Person identity, source product, template ID) updated as per pre-prod database.

          CC : Rohan J Khandave Harshveer Singh Samir

          Show
          akash.thakur Akash Thakur (Inactive) added a comment - - edited Changes done in GenerateDocumentControllerTest.cs (all test run successfully) Moved API URL to constants avoided duplicate string everywhere. Resolved correct dependencies for GenerateDocumentController & removed unused services. Removed outdated hardcoded Authorization header values replaced to constants. NOTE: Remaining hardcoded values(Person identity, source product, template ID) updated as per pre-prod database. CC :  Rohan J Khandave Harshveer Singh Samir
          Hide
          Raj.Hawaldar Raj Hawaldar (Inactive) added a comment -

          Changes completed in CandidateProfileControllerTest.

          • Removed outdated data from TestSuite.
          • Hardcoded values updated as per the Pre-Production Database.
          • Parameters added to getDocumentDto(bool flag).
          • StaticFunctions.GetDBContext() is used.

          All test are running for CandidateProfileController.
          Regards,
          Raj

          Show
          Raj.Hawaldar Raj Hawaldar (Inactive) added a comment - Changes completed in CandidateProfileControllerTest. Removed outdated data from TestSuite. Hardcoded values updated as per the Pre-Production Database. Parameters added to getDocumentDto(bool flag). StaticFunctions.GetDBContext() is used. All test are running for CandidateProfileController. Regards, Raj
          Hide
          sonali.farakate Sonali Farakate (Inactive) added a comment -
          • Changes done in CandidateProfileTests.cs
            Mock data was missing for document, documentTemplate, person, users. So added mock data for these tables.
            Following mock routines added :
          1. GetPersonIdFromEmail
          2. GetTemplateFieldDetails
          • Changes done in  ProvisioningAPILogicTests
            Changes in unit test parameters.

          Thanks,
          Sonali Farakate

          Show
          sonali.farakate Sonali Farakate (Inactive) added a comment - Changes done in CandidateProfileTests.cs Mock data was missing for document, documentTemplate, person, users. So added mock data for these tables. Following mock routines added : GetPersonIdFromEmail GetTemplateFieldDetails Changes done in  ProvisioningAPILogicTests Changes in unit test parameters. Thanks, Sonali Farakate
          Hide
          ramya.tantry Ramya Tantry (Inactive) added a comment -

          Changes done in ProvisioningApiTest

          1. Authentication changes for all test cases written
          2. Removed comments 
          3. Removed unnecessary usings
          4. Removed unnecessary functions created.
          5. Created different input objects for Insert update testcases.

          All 18 test cases are running for ProvisioningApiTest

          CC: Rohan J Khandave

          Show
          ramya.tantry Ramya Tantry (Inactive) added a comment - Changes done in ProvisioningApiTest Authentication changes for all test cases written Removed comments  Removed unnecessary usings Removed unnecessary functions created. Created different input objects for Insert update testcases. All 18 test cases are running for ProvisioningApiTest CC: Rohan J Khandave
          Hide
          rohan.khandave Rohan J Khandave (Inactive) added a comment -

          Done with test case changes. Please take latest of DMS-1900 branch.

          Show
          rohan.khandave Rohan J Khandave (Inactive) added a comment - Done with test case changes. Please take latest of DMS-1900 branch.
          Hide
          priya.dhamande Priya Dhamande (Inactive) added a comment -

          No QA inputs required. So, marking jira done.

          Rohan J Khandave Samir Ramya Tantry Sachin Hingole Hrishikesh Deshpande

          Show
          priya.dhamande Priya Dhamande (Inactive) added a comment - No QA inputs required. So, marking jira done. Rohan J Khandave Samir Ramya Tantry Sachin Hingole Hrishikesh Deshpande

            People

            Assignee:
            rohan.khandave Rohan J Khandave (Inactive)
            Reporter:
            rohan.khandave Rohan J Khandave (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 64h Original Estimate - 64h
                64h
                Remaining:
                Time Spent - 47.25h Remaining Estimate - 20h
                20h
                Logged:
                Time Spent - 47.25h Remaining Estimate - 20h
                47.25h