microsoft-authentication-library-for-android
microsoft-authentication-library-for-android copied to clipboard
Native auth safe logging test
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 whenallowPII=falsebut can exist whenallowPII=true - Integrate
CountDownLatch(logNumbersGenerated)within the callback and add assertion for timeout oflatch.await() - Check the log message's validation inside
loggerCallbackwithfail()and variablefailCalled. - Use
@ParameterizedRobolectricTestRunner.Parametersin order to test bothallow=false & allowPII=trueforRunWith(ParameterizedRobolectricTestRunner::class) NativeAuthPublicClientApplicationKotlinTest(private val allowPII: Boolean)