What is the easiest way to mock a FirebaseToken
,usually returned by the FirebaseAuth.getInstance().verifyIdTokenAsync(idToken)
method. My authentication function calls this method and returns the FirebaseToken. I would like to test my authenticated route, but unfortunately FirebaseToken
isn't an interface. I wonder why this design decision was taken.
The constructor of FirebaseToken
takes a FirebaseTokenImpl
which in turn takes Header header, Payload payload, byte[] signatureBytes, byte[] signedContentBytes
. Payload is a static class with private fields.
I think the easiest option would be to map the FirebaseToken onto my own token representation class in the real authentication function, so that I can mock it easily in the overridden fake authenticator.
The second option, without any useless overhead, would be to find a way to instantiate a FirebaseToken. Unfortunately I need help with that. How do I create an instance of FirebaseToken with my chosen uid, mail etc?
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I am beginner in Android ProgrammingI wanted to do a simple java code where Alexa will send a message to my Android and my cell will show this message
I am creating a command-line interpreter in Python 3x using the cmd2 module
I designed a notification service in Angular 5 using ngrxThe Notification component works
I have a webpage with 3 buttons and a "result" section: