braintree / braintree_java

Braintree Java library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
158 stars 98 forks source link

Interactions with MerchantAccountGateway are hard to test because class is marked as final. #64

Closed kmichalak closed 5 years ago

kmichalak commented 6 years ago

General information

Issue description

The class com.braintreegateway.MerchantAccountGateway has been marked as final, what makes it pretty hard to use in tests. As I can see it's the only gateway class that has been implemented in that way. Is there any specific reason for that? If not could you please change this, as without using additional libraries that can mock MerchantAccountGateway object through reflection it is pretty hard to write tests which include this gateway in the flow.

crookedneighbor commented 6 years ago

Sorry for the delay. Thanks for the report, we're looking into this. It's not the only one that uses this pattern, but the ones that do are in the minority. I'm going to review them and see if we can make this change.

crookedneighbor commented 5 years ago

This is fixed in 2.84.0