We have quite a bit of code duplication in our current unit tests, and a lot of unnecessary abstraction. I'm cleaning this up a bit before proceeding to the next stages of the multi-tenancy implementation.
Moved the test IPublicKeySource and ISigner to a new JwtTestUtils class for easier sharing across test classes.
Moved the logic in the existing TestConfig classes to 2 new classes: AuthBuilder and MockTokenBuilder. These new classes can be composed in test classes as needed.
TestConfig classes are now simpler due to the above composition. We also no longer need to subclass TestConfig in each test class.
Removing a layer of indirection in FirebaseTokenVerifierArgs by dropping the ForIdTokens() method. Similarly we can remove the ForSessionCookies() method in the future.
We have quite a bit of code duplication in our current unit tests, and a lot of unnecessary abstraction. I'm cleaning this up a bit before proceeding to the next stages of the multi-tenancy implementation.
IPublicKeySource
andISigner
to a newJwtTestUtils
class for easier sharing across test classes.TestConfig
classes to 2 new classes:AuthBuilder
andMockTokenBuilder
. These new classes can be composed in test classes as needed.TestConfig
classes are now simpler due to the above composition. We also no longer need to subclassTestConfig
in each test class.FirebaseTokenVerifierArgs
by dropping theForIdTokens()
method. Similarly we can remove theForSessionCookies()
method in the future.