- Operating System version: N/A
- Firebase SDK version: 2
- Library version: 6.12.2
- Firebase Product: Messaging
Description:
BatchResponse is implemented as a final class with a package-private constructor. As such, this means that as a consumer of the library I have to either wrap the response object or use reflection to make it testable.
Steps to reproduce:
// This will not compile
new BatchResponse(responses);
Suggestions
I would be happy to submit a PR for this but I would like guidance on implementation preference.
a) Remove the final keyword from the BatchResponse class so tools like Mockito can mock the class.
b) Make the constructor public
c) Add a builder or some other method of instantiating the class. This doesn't seem like a useful change.
Description:
BatchResponse is implemented as a final class with a package-private constructor. As such, this means that as a consumer of the library I have to either wrap the response object or use reflection to make it testable.
Steps to reproduce:
Suggestions
I would be happy to submit a PR for this but I would like guidance on implementation preference.
a) Remove the final keyword from the BatchResponse class so tools like Mockito can mock the class.
b) Make the constructor public
c) Add a builder or some other method of instantiating the class. This doesn't seem like a useful change.