For those DAO, Services, how about using static objects with mockk for test

This page summarizes the projects mentioned and recommended in the original post on /r/u_Fun_Indication4997

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • mockk

    mocking library for Kotlin

  • The official suggests using dagger/hilt to inject them. However, they could be static based on the static ApplicationContext. Although Dagger/hilt aids in unit testing, mockk can accomplish this easily as well by modifying bytecode during run time. As for the stability, `mockk` has 5000+ stars on GitHub and keeps renewing.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts