commons-beanutils icon indicating copy to clipboard operation
commons-beanutils copied to clipboard

Refactor IntrospectionContextTestImpl in SuppressPropertiesBeanIntros…

Open wx930910 opened this issue 4 years ago • 1 comments

Fix BEANUTILS-551

Description

Replace test class IntrospectionContextTestImpl by mocking object and improve test design


Motivation
  • Decouple test class IntrospectionContextTestImpl from production interface IntrospectionContext.
  • 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 removedProperties as 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

wx930910 avatar Sep 06 '21 02:09 wx930910

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.

garydgregory avatar Sep 10 '21 20:09 garydgregory