Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-1328

[poc] refactor internal/handler/ to make easy unit test them

      Goal: 

      • Refactor api handlers so that unit tests can be created for them.

      Acceptance Criteria:

      • I can instantiate a specific api handler without all the routing.
      • I can instantiate a specific api handler without a database.
      • I can mock the dependencies by injecting them (interactor, repository and presenter components) from the unit test.

      Additional notes:

      • The current sqlmock helper will help to avoid to inject the database, but that component won't be used as the repository should be possible to mock.
      • The refactor above will allow to unit test the handler/ components without run an echo instance.

      Related: HMSIDM-218

              Unassigned Unassigned
              avisiedo@redhat.com Alejandro Visiedo
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: