title: Koin: NoBeanDefFoundException, Check your module definitions
body: <p>The koin test results as follows:</p>
  
  <p><code>org.koin.core.error.NoBeanDefFoundException: No definition found for '&lt;class_name&gt;' has been found. Check your module definitions.
  </code></p>
  
  <p>the class <code>EmailValidatorUtilImpl</code> is well implemented, </p>
  
  <pre><code>import org.junit.After
  import org.junit.Assert
  import org.junit.Before
  import org.junit.Test
  import org.koin.core.context.startKoin
  import org.koin.core.context.stopKoin
  import org.koin.dsl.module
  import org.koin.test.KoinTest
  import org.koin.test.inject
  
  class EmailValidatorUtilImpl : EmailValidatorUtil {
  
      private val pattern = Pattern.compile(EMAIL_PATTERN)
      private var matcher: Matcher? = null
  
      override fun validateEmail(email: String): Boolean {
          matcher = pattern.matcher(email)
          return matcher!!.matches()
      }
  
      companion object {
          private val EMAIL_PATTERN = "^[a-zA-Z0-9#_~!$&amp;'()*+,;=:.\"(),:;&lt;&gt;@\\[\\]\\\\]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*$"
      }
  }
  
  </code></pre>
  
  <p>and also, injected in KoinTest as below:</p>
  
  <pre><code>
  class EmailValidatorUtilImplTest : KoinTest, KoinComponent {
  
      private val validatorUtilImpl: EmailValidatorUtilImpl by inject()
  
      @Before
      fun setUp() {
          startKoin { module { single { EmailValidatorUtilImpl } } }
      }
  
      @Test
      fun `is valid email returns true`() {
          val isEmailValid = validatorUtilImpl.validateEmail("someone@somewhere.com")
          Assert.assertTrue(isEmailValid)
      }
  
      @Test
      fun `is invalid email returns false`() {
          val isEmailValid = validatorUtilImpl.validateEmail("invalid_email")
          Assert.assertFalse(isEmailValid)
      }
  
      @After
      fun tearDown() {
          stopKoin()
      }
  }
  </code></pre>
  
  <p>furthermore, the implementation class is been well injected as </p>
  
  <pre><code>
  var loginUtilsModule = module {
      single { EmailValidatorUtilImpl() }
  }
  
  </code></pre>
  
  <p>in Application class:</p>
  
  <pre><code>startKoin {
              androidLogger(Level.DEBUG)
              androidContext(this@SampleApplication)
              modules(listOf(
                      loginUtilsModule
              ))
          }
  </code></pre>
  
  <p>dependencies (app/build.gradle):</p>
  
  <pre><code>
      // di
      implementation 'org.koin:koin-androidx-viewmodel:2.0.1'
      implementation 'org.koin:koin-androidx-scope:2.0.1'
      implementation 'org.koin:koin-android:2.0.1'
  
      // test
      testImplementation 'org.mockito:mockito-core:2.28.2'
      testImplementation 'org.koin:koin-test:2.0.1'
      testImplementation 'junit:junit:4.12'
  
      // android test
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
      androidTestImplementation 'androidx.test:runner:1.2.0'
      androidTestImplementation 'org.koin:koin-test:2.0.1'
  </code></pre>