Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Proto field predicates when populating with custom ra… #34

Closed
wants to merge 1 commit into from

Conversation

carborgar
Copy link
Collaborator

Fix for #33

Didn't work on the base repository as it involves exposing a property. Sorry it if was not the correct flow

@carborgar carborgar requested a review from dvgaba June 2, 2023 09:14
@carborgar
Copy link
Collaborator Author

just let me know if there's something wrong

@dvgaba
Copy link
Owner

dvgaba commented Jun 15, 2023

Looking into it.

@dvgaba
Copy link
Owner

dvgaba commented Jun 15, 2023

This isn't working, checking what needs to be done

@Test void shouldUseCustomProviderRegistryToFillFieldByType(){ EasyRandomParameters parameters = new EasyRandomParameters() .randomize(ProtobufPredicates.ofProtobufType( Int32Value.class), () -> 42); EasyRandom easyRandom = new EasyRandom(parameters); Proto3Message protoInstance = easyRandom.nextObject(Proto3Message.class); assertThat(protoInstance.getInt32Field()).isEqualTo(42); }

@@ -210,4 +210,15 @@ void shouldUseCustomRandomizerForSubMessageWhenItsDefined() {
assertThat(protoInstance.hasEmbeddedMessage()).isTrue();
assertThat(protoInstance.getEmbeddedMessage()).isEqualTo(customEmbeddedMessage);
}

@Test
void shouldUseCustomProviderRegistryToFillFields(){
Copy link
Owner

Choose a reason for hiding this comment

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

IMO we need to add support for byType as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will take a look, thanks for the feedback!

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.

2 participants