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

[ JSTEP-10 ] Migrate avro module tests to JUnit 5 #549

Merged

Conversation

JooHyukKim
Copy link
Member

@JooHyukKim JooHyukKim commented Jan 11, 2025

related #547

Blocked by #548

@JooHyukKim JooHyukKim marked this pull request as draft January 11, 2025 15:32
Comment on lines 28 to 36
@MethodSource("getParameters")
@ParameterizedTest(name = "{3}")
public void testEmptyRecordWithRecordValues(
Function<Type, Schema> schemaFunctor, BiFunction<Schema, Object, byte[]> serializeFunctor,
BiFunction<Schema, byte[], Object> deserializeFunctor, String combinationName)
throws IOException
{
useParameters(schemaFunctor, serializeFunctor, deserializeFunctor);

Copy link
Member Author

Choose a reason for hiding this comment

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

@cowtowncoder @yawkat @pjfanning Just a small question, by any chance you know any alternate option to solve this problem, regarding JUnit4 parameterized test mechanism?

Seems like with Junit4 declaring Parameterized in super abstract class InteropTestBase would take effect on all extended classes' tests and I have not managed to find corresponding solution JUnit5

Copy link
Member

Choose a reason for hiding this comment

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

https://www.baeldung.com/parameterized-tests-junit-5 looks like this covers it - another jar seems to be needed - junit-jupiter-params

Copy link
Member Author

Choose a reason for hiding this comment

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

Also possible this tutorial with source code example.

Copy link
Member Author

Choose a reason for hiding this comment

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

@pjfanning Thank you for sharing another reference, tho I am not sure which feature from the baeldung tutorial you are refering to?

Copy link
Member

Choose a reason for hiding this comment

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

can't you leave this test as junit 4 and log an issue to return to it?

Copy link
Member

Choose a reason for hiding this comment

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

While it'd be great to convert it, leaving it for now is fine if full solution would take longer.
jackson-databind, f.ex, has trace amount of JUnit 4 for ConcurrentLinkedHashMap tests but everything else is converted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Make sense putting it aside for later 😆
thank you for ideas @pjfanning, @cowtowncoder

@JooHyukKim JooHyukKim marked this pull request as ready for review January 12, 2025 02:02
@JooHyukKim JooHyukKim marked this pull request as draft January 12, 2025 03:30
Copy link
Member Author

@JooHyukKim JooHyukKim left a comment

Choose a reason for hiding this comment

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

Looks ready

@JooHyukKim JooHyukKim marked this pull request as ready for review January 12, 2025 07:15
@cowtowncoder cowtowncoder merged commit 40c7633 into FasterXML:2.19 Jan 12, 2025
4 checks passed
@cowtowncoder
Copy link
Member

Merged to master.

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.

3 participants