Skip to content

SetterTester and GetterTester improvement#90

Open
rcriosbr wants to merge 2 commits intoOpenPojo:masterfrom
rcriosbr:master
Open

SetterTester and GetterTester improvement#90
rcriosbr wants to merge 2 commits intoOpenPojo:masterfrom
rcriosbr:master

Conversation

@rcriosbr
Copy link

@rcriosbr rcriosbr commented Sep 7, 2016

Improved SetterTester and GetterTester classes which introduces the possibility of jump / skip some fields during the validation class.

validation.

Sometimes when build unit tests for legacy code, you can find bad
programming from people that put business logic inside getter/setter.

And, since you cannot refactor it, OpenPojo fails. To avoid skipping the
entire class because a field, this modification helps it.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 93.634% when pulling 988e202 on rcriosbr:master into 8f56182 on oshoukry:master.

validation.

Sometimes when build unit tests for legacy code, you can find bad
programming from people that put business logic inside getter/setter.

And, since you cannot refactor it, OpenPojo fails. To avoid skipping the
entire class because a field, this modification helps it.
public void test() {
PojoClass personPojo = PojoClassFactory.getPojoClass(Person.class);

SetterTester setterTester = new SetterTester();
Copy link

@konrad7d konrad7d Feb 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about supplying skipped fields via constructor?

SetterTester setterTester = new SetterTester(String... skippedFields);

Copy link

@konrad7d konrad7d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this pull request. I've noticed, it's quite old though. Is there anything stopping us from merging it?

@dtrouillet
Copy link

dtrouillet commented Jul 31, 2017

Hi all,

Why this use full PR isnot merged?

@sualeh
Copy link

sualeh commented Feb 3, 2019

@oshoukry - any thoughts on including something like this into the next release?

@stevensouza
Copy link

See issue 66 for other comments relevant to this enhancement as well as a workaround until this or a similar change makes it into the code base.

@Tholian
Copy link

Tholian commented Mar 30, 2020

Hi @oshoukry , could you please give a statement whether or not this PR will make it to the baseline?
I think it's a good feature to be more flexible and would love to see this functionality in the library.

So please let us know what to do to enhance OpenPojo.

Sincerely
Tholian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants