commons-beanutils
commons-beanutils copied to clipboard
Refactor IntrospectionContextTestImpl in SuppressPropertiesBeanIntros…
Fix BEANUTILS-551
Description
Replace test class IntrospectionContextTestImpl by mocking object and improve test design
Motivation
- Decouple test class
IntrospectionContextTestImplfrom production interfaceIntrospectionContext. - Extract attribute into test cases to make test condition more explict.
- Make test logic more clear by using method stub instead of method overriding.
Key changed/added classes in this PR
- Created mocking object to replace test subclass
IntrospectionContextTestImpl, decoupled test from production code. - Extract
removedPropertiesas a local variable to improve test logic and make test condition more explict. - Make test logic more clear by using method stub instead of method overriding.
- Add Mockito dependency
I'm going to say no here for the same reason as for the similar PRs proposed in other Commons components: this makes the code harder to follow and maintain and does not offer benefits.