microsoft-authentication-library-for-android icon indicating copy to clipboard operation
microsoft-authentication-library-for-android copied to clipboard

Native auth safe logging test

Open Yuki-YuXin opened this issue 1 year ago • 0 comments

Comments and Changes Summary:

  • Use Regex rules to filter the log message under loggerCallback. There are two pools for the regex rules: infoPIIToCheck - items should not exist in the log regardless of allowPII value; allowPIIFalseToCheck - items should not exist in the log when allowPII=false but can exist when allowPII=true
  • Integrate CountDownLatch(logNumbersGenerated) within the callback and add assertion for timeout of latch.await()
  • Check the log message's validation inside loggerCallback with fail() and variable failCalled .
  • Use @ParameterizedRobolectricTestRunner.Parameters in order to test both allow=false & allowPII=true for RunWith(ParameterizedRobolectricTestRunner::class) NativeAuthPublicClientApplicationKotlinTest(private val allowPII: Boolean)

Yuki-YuXin avatar Apr 29 '24 14:04 Yuki-YuXin