Skip to content

[PROPOSAL] ModelTestCase.mapper improvements #770

Description

@channel-dante

What/Why

What are you proposing?

  • Modify the ModelTestCase model's mapper to use only one fixedly or both to use both fixedly.
image

What problems are you trying to solve?

  • I don't think it's good code if a test passes or breaks randomly. It seems like a good idea to organize the reasons for using two mappers and improve it so that they are always used when both are needed.

What is the developer experience going to be?

  • No more cases of partially passing or failing tests

Activity

  1. dblock commented on Dec 18, 2023

    @dblock
    Member

    100% thanks!

  2. added
    bugSomething isn't working
    and removed on Dec 18, 2023
  3. channel-dante commented on Dec 19, 2023

    @channel-dante
    ContributorAuthor

    @dblock Do you think that both mapper should support here? I think I can work on it once the decision is made.

  4. Jai2305 commented on Jul 7, 2024

    @Jai2305
    Contributor

    Hi @channel-dante and @dblock , we are adding a default Mapper in JsonUtils in this PR , please follow this comment to know the context, I think we can use that , rather than hardcoding one of them, the idea is to take the provider from the classpath instead of hardcoding one of the jakarta or Jackson

    Caution : the methods in the mapper are overridden to provide support for the classes which implement JsonpSerializable

  5. dblock commented on Jul 8, 2024

    @dblock
    Member

    I am not sure what the implications of either are, let's look at the code! Thank you.

  6. Tejashribambal19 commented on Jul 1, 2026

    @Tejashribambal19

    Hi, I'd like to work on this issue.

    I investigated ModelTestCase and confirmed it still randomly chooses between JsonbJsonpMapper and JacksonJsonpMapper using RAND.

    Since the proposed JsonUtils mentioned in the discussion doesn't exist in the current main branch, I'd like to confirm the expected solution before implementing it.

    Should ModelTestCase:

    1. Always use a single mapper (Jackson or JsonB), or
    2. Be updated to run deterministically with both mappers?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions