Skip to content

Eliminating mocks #182

@milosmns

Description

@milosmns

Provide a brief summary of the planned work

Mocks are getting difficult to manage and looking more like technical debt. Let's replace them with simple fakes.

Detailed overview

There are uses for mocks, fakes, stubs, dummies, and spies. However, this project has reached a stability phase where we shouldn't have many mocks for which we must influence behavior almost before each call (not even talking about test teardown).

This article explains the benefits of fakes well.
Martin Fowler's article is also excellent, differentiating between these test doubles.

Considering these ideas, we would better use fakes in this project; we can get inspired by the TimeProvider fake and discouraged by the User Repository mocks.

Hint/location:

com.appifyhub.monolith.features.user.repository.UserRepositoryImplTest#setup
com/appifyhub/monolith/util/TimeProviderFake.kt:17

List the acceptance criteria

  • All mocks have been replaced by fakes
  • Mockito has been removed as a dependency of the project
  • All tests have been updated to reflect these changes, and passing

Include any additional notes (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestPlannedPlanned and roadmapped work

    Type

    No type

    Projects

    Status

    Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions